From a14b1ded69dc76f4e41ef60eeab89dc8575af44b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 13 Mar 2009 16:25:21 +0000 Subject: 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 getName() + ": " + Msg; + throw TGError(TheRecord->getLoc(), "In " + TheRecord->getName() + ": " + Msg); } TreePatternNode *TreePattern::ParseTreePattern(DagInit *Dag) { -- cgit v1.2.3-18-g5258