summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2018-04-01 17:08:49 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2018-04-01 17:08:49 +0000
commit24e3a4d6e93cb589d854227a9674acb0ca0c4679 (patch)
tree272428a5ad5705ac49210132056c613453b37721 /llvm/utils
parentfe1d28e83d456b791958a63b550ca71dcc627c57 (diff)
downloadbcm5719-llvm-24e3a4d6e93cb589d854227a9674acb0ca0c4679.tar.gz
bcm5719-llvm-24e3a4d6e93cb589d854227a9674acb0ca0c4679.zip
TableGen: More helpful error messages
Summary: Change-Id: I3c23f6f6597912423762780cd8c5315870412bbe Reviewers: arsenm, rampitec, b-sumner Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D44936 Change-Id: Ie62614a3e2d7774f46e4034478b28f57100a2c92 llvm-svn: 328936
Diffstat (limited to 'llvm/utils')
-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