]> granicus.if.org Git - llvm/commitdiff
Move some LAST_* enum sentinels out of their enums
authorReid Kleckner <rnk@google.com>
Wed, 15 Mar 2017 17:43:40 +0000 (17:43 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 15 Mar 2017 17:43:40 +0000 (17:43 +0000)
These are not valid values of the enum, so this will improve clang
-Wcovered-switch-default diagnostics. It also fixes some
-Wbitfield-enum-conversion warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297863 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ISDOpcodes.h

index d595d43af50442a6df954142d24cdff279062305..ee3fd0bdda2a997aa8ce33bfaef49d13d387f103 100644 (file)
@@ -814,10 +814,11 @@ namespace ISD {
     PRE_INC,
     PRE_DEC,
     POST_INC,
-    POST_DEC,
-    LAST_INDEXED_MODE
+    POST_DEC
   };
 
+  static const int LAST_INDEXED_MODE = POST_DEC + 1;
+
   //===--------------------------------------------------------------------===//
   /// LoadExtType enum - This enum defines the three variants of LOADEXT
   /// (load with extension).
@@ -832,10 +833,11 @@ namespace ISD {
     NON_EXTLOAD = 0,
     EXTLOAD,
     SEXTLOAD,
-    ZEXTLOAD,
-    LAST_LOADEXT_TYPE
+    ZEXTLOAD
   };
 
+  static const int LAST_LOADEXT_TYPE = ZEXTLOAD + 1;
+
   NodeType getExtForLoadExtType(bool IsFP, LoadExtType);
 
   //===--------------------------------------------------------------------===//