[llvm] r328936 - TableGen: More helpful error messages
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 1 10:08:49 PDT 2018
Author: nha
Date: Sun Apr 1 10:08:49 2018
New Revision: 328936
URL: http://llvm.org/viewvc/llvm-project?rev=328936&view=rev
Log:
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
Modified:
llvm/trunk/utils/TableGen/CodeGenTarget.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=328936&r1=328935&r2=328936&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Sun Apr 1 10:08:49 2018
@@ -615,8 +615,12 @@ CodeGenIntrinsic::CodeGenIntrinsic(Recor
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
More information about the llvm-commits
mailing list