[llvm-commits] [llvm] r140034 - /llvm/trunk/utils/TableGen/TGParser.cpp
David Greene
greened at obbligato.org
Mon Sep 19 11:26:07 PDT 2011
Author: greened
Date: Mon Sep 19 13:26:07 2011
New Revision: 140034
URL: http://llvm.org/viewvc/llvm-project?rev=140034&view=rev
Log:
Better Error Reporting
Report missing template arguments more helpfully by supplying the name
of the missing argument in the error message.
Modified:
llvm/trunk/utils/TableGen/TGParser.cpp
Modified: llvm/trunk/utils/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGParser.cpp?rev=140034&r1=140033&r2=140034&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/TGParser.cpp (original)
+++ llvm/trunk/utils/TableGen/TGParser.cpp Mon Sep 19 13:26:07 2011
@@ -1416,6 +1416,10 @@
if (ArgsRec != 0 && EltTy == 0) {
const std::vector<std::string> &TArgs = ArgsRec->getTemplateArgs();
const RecordVal *RV = ArgsRec->getValue(TArgs[ArgN]);
+ if (!RV) {
+ errs() << "Cannot find template arg " << ArgN << " (" << TArgs[ArgN]
+ << ")\n";
+ }
assert(RV && "Template argument record not found??");
ItemType = RV->getType();
++ArgN;
More information about the llvm-commits
mailing list