[llvm] r256697 - [TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 2 23:33:34 PST 2016


Author: ctopper
Date: Sun Jan  3 01:33:34 2016
New Revision: 256697

URL: http://llvm.org/viewvc/llvm-project?rev=256697&view=rev
Log:
[TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.

Modified:
    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=256697&r1=256696&r2=256697&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Jan  3 01:33:34 2016
@@ -2170,11 +2170,12 @@ static void emitIsSubclass(CodeGenTarget
       OS << "    return false;\n";
     }
   }
-  OS << "  }\n";
 
   // If there were case statements emitted into the string stream write the
   // default.
-  if (!EmittedSwitch)
+  if (EmittedSwitch)
+    OS << "  }\n";
+  else
     OS << "  return false;\n";
 
   OS << "}\n\n";




More information about the llvm-commits mailing list