add a new TGError class and use it to propagate location info with
[oota-llvm.git] / utils / TableGen / CodeGenDAGPatterns.cpp
index 6e7dd1eae05dd9a946434f53196f2b939d24f9f5..6af05158f1cd26d79abf241c5498586d4b092170 100644 (file)
@@ -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) {