Skip to content

Commit

Permalink
[TableGen] more helpful error message in MapTableEmitter
Browse files Browse the repository at this point in the history
Differential Revision: http://reviews.llvm.org/D17275

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263148 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
nhaehnle committed Mar 10, 2016
1 parent b738b28 commit 5dae380
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions utils/TableGen/CodeGenMapTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,20 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
}

if (MatchFound) {
if (MatchInstr) // Already had a match
if (MatchInstr) {
// Already had a match
// Error if multiple matches are found for a column.
std::string KeyValueStr;
for (Init *Value : KeyValue) {
if (!KeyValueStr.empty())
KeyValueStr += ", ";
KeyValueStr += Value->getAsString();
}

PrintFatalError("Multiple matches found for `" + KeyInstr->getName() +
"', for the relation `" + InstrMapDesc.getName());
"', for the relation `" + InstrMapDesc.getName() + "', row fields [" +
KeyValueStr + "], column `" + CurValueCol->getAsString() + "'");
}
MatchInstr = CurInstr;
}
}
Expand Down

0 comments on commit 5dae380

Please sign in to comment.