[PATCH] D23766: DebugInfo: use strongly typed enum for debug info flags

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 14:16:21 PDT 2016


dblaikie added inline comments.

================
Comment at: include/llvm/IR/DebugInfoMetadata.h:175-182
@@ -173,8 +174,10 @@
   /// in the first two bits.
-  enum DIFlags {
+  enum DIFlags : uint32_t {
 #define HANDLE_DI_FLAG(ID, NAME) Flag##NAME = ID,
 #include "llvm/IR/DebugInfoFlags.def"
     FlagAccessibility = FlagPrivate | FlagProtected | FlagPublic,
     FlagPtrToMemberRep = FlagSingleInheritance | FlagMultipleInheritance |
                          FlagVirtualInheritance,
+    LLVM_MARK_AS_BITMASK_ENUM(FlagLargest)
   };
+  typedef std::underlying_type<DIFlags>::type DIFlagsUnderlying;
----------------
Should we move this outside the class so it doesn't have to be qualified in lots of places? The name already has the 'scoping' of the DI prefix, not sure it's particularly helpful that it's inside DINode too.

================
Comment at: include/llvm/IR/DebugInfoMetadata.h:183
@@ -180,2 +182,3 @@
   };
+  typedef std::underlying_type<DIFlags>::type DIFlagsUnderlying;
 
----------------
I'm assuming we don't need DIFlagsUnderlying anymore? Can we just use DIFlags everywhere?


https://reviews.llvm.org/D23766





More information about the llvm-commits mailing list