summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-11-30 23:16:25 +0000
committerJim Grosbach <grosbach@apple.com>2011-11-30 23:16:25 +0000
commit8eeb3530718138b8b7d8ad436bfa318b1cdde895 (patch)
tree578a6293f136ab811ce93329084ab7b56d2cb1df
parentd8bcb2b808f65eca7db7ce8f9945ecfb934e41e4 (diff)
downloadbcm5719-llvm-8eeb3530718138b8b7d8ad436bfa318b1cdde895.tar.gz
bcm5719-llvm-8eeb3530718138b8b7d8ad436bfa318b1cdde895.zip
Replace an assert() with an actual diagnostic.
llvm-svn: 145535
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 01754c3f91e..9f897685c2f 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -737,7 +737,9 @@ void MatchableInfo::TokenizeAsmString(const AsmMatcherInfo &Info) {
// The first token of the instruction is the mnemonic, which must be a
// simple string, not a $foo variable or a singleton register.
- assert(!AsmOperands.empty() && "Instruction has no tokens?");
+ if (AsmOperands.empty())
+ throw TGError(TheDef->getLoc(),
+ "Instruction '" + TheDef->getName() + "' has no tokens");
Mnemonic = AsmOperands[0].Token;
if (Mnemonic[0] == '$' || getSingletonRegisterForAsmOperand(0, Info))
throw TGError(TheDef->getLoc(),
OpenPOWER on IntegriCloud