14 #ifndef LLVM_LIB_TABLEGEN_TGPARSER_H 15 #define LLVM_LIB_TABLEGEN_TGPARSER_H 32 struct SubClassReference;
33 struct SubMultiClassReference;
37 std::vector<unsigned>
Bits;
41 : Name(N), Bits(B), Value(V), Loc(L) {
47 std::unique_ptr<Record>
Rec;
48 std::unique_ptr<ForeachLoop>
Loop;
55 : Loop(
std::move(Loop)) {}
69 : Loc(Loc), IterVar(IVar), ListValue(LValue) {}
85 Rec(Name, Loc, Records) {}
90 std::vector<SmallVector<LetRecord, 4>> LetStack;
91 std::map<std::string, std::unique_ptr<MultiClass>> MultiClasses;
95 std::vector<std::unique_ptr<ForeachLoop>>
Loops;
120 : Lex(SrcMgr, Macros), CurMultiClass(nullptr), Records(records) {}
141 bool AllowSelfAssignment =
false);
151 std::vector<RecordsEntry> *Dest,
SMLoc *Loc =
nullptr);
153 bool Final, std::vector<RecordsEntry> *Dest,
154 SMLoc *Loc =
nullptr);
155 bool addDefOne(std::unique_ptr<Record> Rec);
158 bool ParseObjectList(
MultiClass *MC =
nullptr);
161 bool ParseMultiClass();
166 bool ParseTopLevelLet(
MultiClass *CurMultiClass);
169 bool ParseObjectBody(
Record *CurRec);
170 bool ParseBody(
Record *CurRec);
171 bool ParseBodyItem(
Record *CurRec);
173 bool ParseTemplateArgList(
Record *CurRec);
174 Init *ParseDeclaration(
Record *CurRec,
bool ParsingTemplateArgs);
175 VarInit *ParseForeachDeclaration(
Init *&ForeachListValue);
181 IDParseMode
Mode = ParseValueMode);
183 IDParseMode
Mode = ParseValueMode);
185 IDParseMode
Mode = ParseValueMode);
187 Record *ArgsRec =
nullptr,
RecTy *EltTy =
nullptr);
188 void ParseDagArgList(
197 RecTy *ParseOperatorType();
201 bool ApplyLetStack(
Record *CurRec);
This class represents lattice values for constants.
static void SetValue(Value *V, GenericValue Val, ExecutionContext &SF)
std::unique_ptr< ForeachLoop > Loop
std::unique_ptr< Record > Rec
RecordsEntry(std::unique_ptr< Record > Rec)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
LetRecord(StringInit *N, ArrayRef< unsigned > B, Init *V, SMLoc L)
ForeachLoop(SMLoc Loc, VarInit *IVar, Init *LValue)
std::vector< RecordsEntry > Entries
MultiClass(StringRef Name, SMLoc Loc, RecordKeeper &Records)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
"foo" - Represent an initialization by a string value.
RecordsEntry - Can be either a record or a foreach loop.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
std::vector< unsigned > Bits
bool Error(SMLoc L, const Twine &Msg) const
ForeachLoop - Record the iteration state associated with a for loop.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
const TGLexer::DependenciesMapTy & getDependencies() const
bool TokError(const Twine &Msg) const
std::map< std::string, SMLoc > DependenciesMapTy
Represents a single loop in the control flow graph.
SmallVector< Init *, 16 > Elements
'Opcode' - Represent a reference to an entire variable object.
TGParser(SourceMgr &SrcMgr, ArrayRef< std::string > Macros, RecordKeeper &records)
RecordsEntry(std::unique_ptr< ForeachLoop > Loop)
const DependenciesMapTy & getDependencies() const
std::vector< RecordsEntry > Entries
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.
void PrintError(ArrayRef< SMLoc > ErrorLoc, const Twine &Msg)
TGLexer - TableGen Lexer class.