diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-13 16:25:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-13 16:25:21 +0000 |
commit | a14b1ded69dc76f4e41ef60eeab89dc8575af44b (patch) | |
tree | 442f96347125ff44bddb8a3c32707364662ad559 /utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | 7b9ffe4a6db2e59c18510aac4ba30902653e13eb (diff) |
add a new TGError class and use it to propagate location info with
errors when thrown. This gets us nice errors like this from tblgen:
CMOVL32rr: (set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: error:
Included from X86.td:116:
Parsing X86InstrInfo.td:922: In CMOVL32rr: X86cmov node requires exactly 4 operands!
def CMOVL32rr : I<0x4C, MRMSrcReg, // if <s, GR32 = GR32
^
instead of just:
CMOVL32rr: (set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: In CMOVL32rr: X86cmov node requires exactly 4 operands!
This is all I plan to do with this, but it should be easy enough to improve if anyone
cares (e.g. keeping more loc info in "dag" expr records in tblgen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 6e7dd1eae0..6af05158f1 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1113,7 +1113,7 @@ TreePattern::TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput, void TreePattern::error(const std::string &Msg) const { dump(); - throw "In " + TheRecord->getName() + ": " + Msg; + throw TGError(TheRecord->getLoc(), "In " + TheRecord->getName() + ": " + Msg); } TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) { |