[llvm-commits] [llvm] r156263 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Jim Grosbach grosbach at apple.com
Sun May 6 10:33:14 PDT 2012


Author: grosbach
Date: Sun May  6 12:33:14 2012
New Revision: 156263

URL: http://llvm.org/viewvc/llvm-project?rev=156263&view=rev
Log:
TableGen: AsmMatcher diagnostic when missing instruction mnemonic.

Previously, if an instruction definition was missing the mnemonic,
the next line would just assert(). Issue a real diagnostic instead.

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=156263&r1=156262&r2=156263&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun May  6 12:33:14 2012
@@ -825,6 +825,9 @@
     throw TGError(TheDef->getLoc(),
                   "Instruction '" + TheDef->getName() + "' has no tokens");
   Mnemonic = AsmOperands[0].Token;
+  if (Mnemonic.empty())
+    throw TGError(TheDef->getLoc(),
+                  "Missing instruction mnemonic");
   // FIXME : Check and raise an error if it is a register.
   if (Mnemonic[0] == '$')
     throw TGError(TheDef->getLoc(),





More information about the llvm-commits mailing list