[PATCH] D18394: [TableGen] AsmMatcherEmitter.cpp: replace a sequence of "if" to "switch" in emitValidateOperandClass. NFC.
    Ahmed Bougacha via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar 28 11:32:19 PDT 2016
    
    
  
ab added a subscriber: ab.
ab added a comment.
Nicer indeed! One question and one nit.
================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2156
@@ -2155,1 +2155,3 @@
   // actually matching against one of them.
+  OS << "  switch(Kind) {\n"
+        "  default: break;\n";
----------------
space before '('
================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2157
@@ -2156,1 +2156,3 @@
+  OS << "  switch(Kind) {\n"
+        "  default: break;\n";
   for (const auto &CI : Info.Classes) {
----------------
Do we ever hit the default? Perhaps you could put an llvm_unreachable().
http://reviews.llvm.org/D18394
    
    
More information about the llvm-commits
mailing list