diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-13 16:09:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-13 16:09:24 +0000 |
commit | bd9b9210c23505931e261f71588437a4818d5ddb (patch) | |
tree | 8b8478fa3688f3481e148a3e1ad88f7e3701ce47 /llvm/utils/TableGen/TGParser.cpp | |
parent | cfb6cf4c021e41db7b36b7909296798d955e8123 (diff) | |
download | bcm5719-llvm-bd9b9210c23505931e261f71588437a4818d5ddb.tar.gz bcm5719-llvm-bd9b9210c23505931e261f71588437a4818d5ddb.zip |
give each Record a location.
llvm-svn: 66897
Diffstat (limited to 'llvm/utils/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/utils/TableGen/TGParser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/TGParser.cpp b/llvm/utils/TableGen/TGParser.cpp index d3eaa929a07..1fa8272727b 100644 --- a/llvm/utils/TableGen/TGParser.cpp +++ b/llvm/utils/TableGen/TGParser.cpp @@ -27,7 +27,7 @@ struct MultiClass { Record Rec; // Placeholder for template args and Name. std::vector<Record*> DefPrototypes; - MultiClass(const std::string &Name) : Rec(Name) {} + MultiClass(const std::string &Name, TGLoc Loc) : Rec(Name, Loc) {} }; struct SubClassReference { @@ -570,7 +570,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec) { // Create the new record, set it as CurRec temporarily. static unsigned AnonCounter = 0; - Record *NewRec = new Record("anonymous.val."+utostr(AnonCounter++)); + Record *NewRec = new Record("anonymous.val."+utostr(AnonCounter++),NameLoc); SubClassReference SCRef; SCRef.RefLoc = NameLoc; SCRef.Rec = Class; @@ -1039,7 +1039,7 @@ llvm::Record *TGParser::ParseDef(MultiClass *CurMultiClass) { Lex.Lex(); // Eat the 'def' token. // Parse ObjectName and make a record for it. - Record *CurRec = new Record(ParseObjectName()); + Record *CurRec = new Record(ParseObjectName(), DefLoc); if (!CurMultiClass) { // Top-level def definition. @@ -1093,7 +1093,7 @@ bool TGParser::ParseClass() { return TokError("Class '" + CurRec->getName() + "' already defined"); } else { // If this is the first reference to this class, create and add it. - CurRec = new Record(Lex.getCurStrVal()); + CurRec = new Record(Lex.getCurStrVal(), Lex.getLoc()); Records.addClass(CurRec); } Lex.Lex(); // eat the name. @@ -1232,7 +1232,7 @@ bool TGParser::ParseMultiClass() { if (MultiClasses.count(Name)) return TokError("multiclass '" + Name + "' already defined"); - CurMultiClass = MultiClasses[Name] = new MultiClass(Name); + CurMultiClass = MultiClasses[Name] = new MultiClass(Name, Lex.getLoc()); Lex.Lex(); // Eat the identifier. // If there are template args, parse them. @@ -1299,7 +1299,7 @@ bool TGParser::ParseDefm() { Record *DefProto = MC->DefPrototypes[i]; // Add the suffix to the defm name to get the new name. - Record *CurRec = new Record(DefmPrefix + DefProto->getName()); + Record *CurRec = new Record(DefmPrefix + DefProto->getName(),DefmPrefixLoc); SubClassReference Ref; Ref.RefLoc = DefmPrefixLoc; |