[llvm] [VirtRegMap] Replace a single value enum with a static constexpr member variable. NFC (PR #109010)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 09:51:22 PDT 2024


================
@@ -32,9 +32,7 @@ class TargetInstrInfo;
 
   class VirtRegMap : public MachineFunctionPass {
   public:
-    enum {
-      NO_STACK_SLOT = (1L << 30)-1,
-    };
+    static constexpr unsigned NO_STACK_SLOT = (1u << 30) - 1;
----------------
topperc wrote:

> judging by the return type of `getStackSlot` this should be `int` instead?

Yep. I had unsigned on the brain, then changed it but forgot to commit it.

https://github.com/llvm/llvm-project/pull/109010


More information about the llvm-commits mailing list