[TableGen] more helpful error message in MapTableEmitter

Differential Revision: http://reviews.llvm.org/D17275

llvm-svn: 263148
This commit is contained in:
Nicolai Haehnle 2016-03-10 18:51:58 +00:00
parent 93e85e1cbb
commit 8e5624582d

View File

@ -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;
}
}