aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-09-12 17:40:25 +0000
committerJim Grosbach <grosbach@apple.com>2012-09-12 17:40:25 +0000
commita562dc7228990797a259f4fef4acb95a83b23e0d (patch)
tree10b58b365043af305ab9480e2d95542e17fbdcde
parentee99c7f1bfe115f8fe2d1b118010a82c1ce83f18 (diff)
downloadexternal_llvm-a562dc7228990797a259f4fef4acb95a83b23e0d.zip
external_llvm-a562dc7228990797a259f4fef4acb95a83b23e0d.tar.gz
external_llvm-a562dc7228990797a259f4fef4acb95a83b23e0d.tar.bz2
TableGen: Convert an assert() to a proper diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163726 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index 78eb641..fcd32dc 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1020,7 +1020,9 @@ AsmMatcherInfo::getOperandClass(Record *Rec, int SubOpIdx) {
throw TGError(Rec->getLoc(), "register class has no class info!");
}
- assert(Rec->isSubClassOf("Operand") && "Unexpected operand!");
+ if (!Rec->isSubClassOf("Operand"))
+ throw TGError(Rec->getLoc(), "Operand `" + Rec->getName() +
+ "' does not derive from class Operand!\n");
Record *MatchClass = Rec->getValueAsDef("ParserMatchClass");
if (ClassInfo *CI = AsmOperandClasses[MatchClass])
return CI;