mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-21 19:36:59 +00:00
Improve TableGen error reporting.
llvm-svn: 74443
This commit is contained in:
parent
28c47d108c
commit
dbba016f7b
@ -1395,7 +1395,7 @@ TGParser::ParseDagArgList(Record *CurRec) {
|
||||
std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec, RecTy *EltTy) {
|
||||
std::vector<Init*> Result;
|
||||
RecTy *ItemType = EltTy;
|
||||
int ArgN = 0;
|
||||
unsigned int ArgN = 0;
|
||||
if (ArgsRec != 0 && EltTy == 0) {
|
||||
const std::vector<std::string> &TArgs = ArgsRec->getTemplateArgs();
|
||||
const RecordVal *RV = ArgsRec->getValue(TArgs[ArgN]);
|
||||
@ -1411,6 +1411,10 @@ std::vector<Init*> TGParser::ParseValueList(Record *CurRec, Record *ArgsRec, Rec
|
||||
|
||||
if (ArgsRec != 0 && EltTy == 0) {
|
||||
const std::vector<std::string> &TArgs = ArgsRec->getTemplateArgs();
|
||||
if (ArgN >= TArgs.size()) {
|
||||
TokError("too many template arguments");
|
||||
return std::vector<Init*>();
|
||||
}
|
||||
const RecordVal *RV = ArgsRec->getValue(TArgs[ArgN]);
|
||||
assert(RV && "Template argument record not found??");
|
||||
ItemType = RV->getType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user