summaryrefslogtreecommitdiff
path: root/utils
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
commit8e27c9615938298bd03a7884964a0f5e0e80542d (patch)
tree5a238b90787c90ab06f073cc526e632831e9c7ba /utils
parenteb034f4af3f84106828c9ca11b0b003c1c86fb49 (diff)
downloadllvm-8e27c9615938298bd03a7884964a0f5e0e80542d.tar.gz
llvm-8e27c9615938298bd03a7884964a0f5e0e80542d.tar.bz2
llvm-8e27c9615938298bd03a7884964a0f5e0e80542d.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index 0cb86d03d7..96e882b19f 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/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(),