summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 32dd8d5fc65..e9b145bdf54 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -615,8 +615,12 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
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
OpenPOWER on IntegriCloud