summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-05-06 17:33:14 +0000
committerJim Grosbach <grosbach@apple.com>2012-05-06 17:33:14 +0000
commit90e8c5e08fce888cb2ebcc21f3e30f22e1a74903 (patch)
treeaf91094773eb76ae01d306964a5ff5c6691e7b5b /llvm
parentd8b1b908b53c38c8fa62a0d6f697a5f5c699c309 (diff)
downloadbcm5719-llvm-90e8c5e08fce888cb2ebcc21f3e30f22e1a74903.tar.gz
bcm5719-llvm-90e8c5e08fce888cb2ebcc21f3e30f22e1a74903.zip
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. llvm-svn: 156263
Diffstat (limited to 'llvm')
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 0cb86d03d72..96e882b19fd 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -825,6 +825,9 @@ void MatchableInfo::tokenizeAsmString(const AsmMatcherInfo &Info) {
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(),
OpenPOWER on IntegriCloud