[PATCH] D44936: TableGen: More helpful error messages
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 27 08:28:21 PDT 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, rampitec, b-sumner.
Herald added a subscriber: wdng.
Change-Id: I3c23f6f6597912423762780cd8c5315870412bbe
Repository:
rL LLVM
https://reviews.llvm.org/D44936
Files:
utils/TableGen/CodeGenTarget.cpp
Index: utils/TableGen/CodeGenTarget.cpp
===================================================================
--- utils/TableGen/CodeGenTarget.cpp
+++ utils/TableGen/CodeGenTarget.cpp
@@ -615,8 +615,12 @@
MVT::SimpleValueType VT;
if (TyEl->isSubClassOf("LLVMMatchType")) {
unsigned MatchTy = TyEl->getValueAsInt("Number");
- assert(MatchTy < OverloadedVTs.size() &&
- "Invalid matching number!");
+ if (MatchTy >= OverloadedVTs.size()) {
+ PrintError(R->getLoc(),
+ "Parameter #" + Twine(i) + " has out of bounds matching "
+ "number " + Twine(MatchTy));
+ PrintFatalError(Twine("ParamTypes is ") + TypeList->getAsString());
+ }
VT = OverloadedVTs[MatchTy];
// It only makes sense to use the extended and truncated vector element
// variants with iAny types; otherwise, if the intrinsic is not
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44936.139937.patch
Type: text/x-patch
Size: 907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180327/ba1131ce/attachment.bin>
More information about the llvm-commits
mailing list