diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-03-10 18:51:58 +0000 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2016-03-10 18:51:58 +0000 |
commit | 411fbbf5f3cc24b953f8fa802c2cc3d004da74f1 (patch) | |
tree | 5d6698a9900cd0deecb26402af4352fa3b8d92f0 /llvm/utils/TableGen/CodeGenMapTable.cpp | |
parent | 3498c7fbd0d8f7cecba9a494b4e5d615b8c0620b (diff) | |
download | bcm5719-llvm-411fbbf5f3cc24b953f8fa802c2cc3d004da74f1.tar.gz bcm5719-llvm-411fbbf5f3cc24b953f8fa802c2cc3d004da74f1.zip |
[TableGen] more helpful error message in MapTableEmitter
Differential Revision: http://reviews.llvm.org/D17275
llvm-svn: 263148
Diffstat (limited to 'llvm/utils/TableGen/CodeGenMapTable.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenMapTable.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenMapTable.cpp b/llvm/utils/TableGen/CodeGenMapTable.cpp index 09ea705ae01..527f530da47 100644 --- a/llvm/utils/TableGen/CodeGenMapTable.cpp +++ b/llvm/utils/TableGen/CodeGenMapTable.cpp @@ -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; } } |