diff options
author | Aleksandar Beserminji <Aleksandar.Beserminji@mips.com> | 2018-01-08 16:25:40 +0000 |
---|---|---|
committer | Aleksandar Beserminji <Aleksandar.Beserminji@mips.com> | 2018-01-08 16:25:40 +0000 |
commit | f02ad15ff1dd84c73958c002966e3b61f8539f18 (patch) | |
tree | e1d014b31dd2d9a34d97ff003b3569c99611da06 /llvm/utils/TableGen/CodeGenMapTable.cpp | |
parent | 6e2d03d4103d1b2032fc18343f8b13568eaefddb (diff) | |
download | bcm5719-llvm-f02ad15ff1dd84c73958c002966e3b61f8539f18.tar.gz bcm5719-llvm-f02ad15ff1dd84c73958c002966e3b61f8539f18.zip |
[mips] Improve diagnostics for instruction mapping
This patch improves diagnostic for case when mapped instruction
does not contain a field listed under RowFields.
Differential Revision: https://reviews.llvm.org/D41778
llvm-svn: 322004
Diffstat (limited to 'llvm/utils/TableGen/CodeGenMapTable.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenMapTable.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenMapTable.cpp b/llvm/utils/TableGen/CodeGenMapTable.cpp index 43348b622a7..e5b0426cdcc 100644 --- a/llvm/utils/TableGen/CodeGenMapTable.cpp +++ b/llvm/utils/TableGen/CodeGenMapTable.cpp @@ -243,7 +243,12 @@ void MapTableEmitter::buildRowInstrMap() { std::vector<Init*> KeyValue; ListInit *RowFields = InstrMapDesc.getRowFields(); for (Init *RowField : RowFields->getValues()) { - Init *CurInstrVal = CurInstr->getValue(RowField)->getValue(); + RecordVal *RecVal = CurInstr->getValue(RowField); + if (RecVal == nullptr) + PrintFatalError(CurInstr->getLoc(), "No value " + + RowField->getAsString() + " found in \"" + + CurInstr->getName() + "\" instruction description."); + Init *CurInstrVal = RecVal->getValue(); KeyValue.push_back(CurInstrVal); } |