[llvm-commits] [llvm] r163726 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Jim Grosbach
grosbach at apple.com
Wed Sep 12 10:40:26 PDT 2012
Author: grosbach
Date: Wed Sep 12 12:40:25 2012
New Revision: 163726
URL: http://llvm.org/viewvc/llvm-project?rev=163726&view=rev
Log:
TableGen: Convert an assert() to a proper diagnostic.
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=163726&r1=163725&r2=163726&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Sep 12 12:40:25 2012
@@ -1020,7 +1020,9 @@
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;
More information about the llvm-commits
mailing list