X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FTGParser.h;h=9f4b634606475504049ecd34fec3b3e57f1a1c0a;hb=2214dc07649d36e47d11914e1ffc7c56eb40ad73;hp=c618708ee97845704d3c90ba3e9c975a3a498705;hpb=099e198ae84c1a6cfe2a7c79ee9f47fa67caac8f;p=oota-llvm.git diff --git a/utils/TableGen/TGParser.h b/utils/TableGen/TGParser.h index c618708ee97..9f4b6346064 100644 --- a/utils/TableGen/TGParser.h +++ b/utils/TableGen/TGParser.h @@ -31,9 +31,9 @@ namespace llvm { std::string Name; std::vector Bits; Init *Value; - TGLoc Loc; + SMLoc Loc; LetRecord(const std::string &N, const std::vector &B, Init *V, - TGLoc L) + SMLoc L) : Name(N), Bits(B), Value(V), Loc(L) { } }; @@ -47,15 +47,13 @@ class TGParser { /// current value. MultiClass *CurMultiClass; public: - TGParser(TGSourceMgr &SrcMgr) : Lex(SrcMgr), CurMultiClass(0) {} + TGParser(SourceMgr &SrcMgr) : Lex(SrcMgr), CurMultiClass(0) {} - void setIncludeDirs(const std::vector &D){Lex.setIncludeDirs(D);} - /// ParseFile - Main entrypoint for parsing a tblgen file. These parser /// routines return true on error, or false on success. bool ParseFile(); - bool Error(TGLoc L, const std::string &Msg) const { + bool Error(SMLoc L, const std::string &Msg) const { Lex.PrintError(L, Msg); return true; } @@ -63,8 +61,8 @@ public: return Error(Lex.getLoc(), Msg); } private: // Semantic analysis methods. - bool AddValue(Record *TheRec, TGLoc Loc, const RecordVal &RV); - bool SetValue(Record *TheRec, TGLoc Loc, const std::string &ValName, + bool AddValue(Record *TheRec, SMLoc Loc, const RecordVal &RV); + bool SetValue(Record *TheRec, SMLoc Loc, const std::string &ValName, const std::vector &BitList, Init *V); bool AddSubClass(Record *Rec, SubClassReference &SubClass); bool AddSubMultiClass(MultiClass *CurMC, @@ -92,7 +90,7 @@ private: // Parser methods. SubMultiClassReference ParseSubMultiClassReference(MultiClass *CurMC); Init *ParseIDValue(Record *CurRec); - Init *ParseIDValue(Record *CurRec, const std::string &Name, TGLoc NameLoc); + Init *ParseIDValue(Record *CurRec, const std::string &Name, SMLoc NameLoc); Init *ParseSimpleValue(Record *CurRec, RecTy *ItemType = 0); Init *ParseValue(Record *CurRec, RecTy *ItemType = 0); std::vector ParseValueList(Record *CurRec, Record *ArgsRec = 0, RecTy *EltTy = 0);