class TGParser

Declaration

class TGParser { /* full declaration omitted */ };

Declared at: llvm/lib/TableGen/TGParser.h:130

Member Variables

private llvm::TGLexer Lex
private std::vector<SmallVector<LetRecord, 4>> LetStack
private std::map<std::string, std::unique_ptr<MultiClass>> MultiClasses
private std::vector<std::unique_ptr<ForeachLoop>> Loops
Loops - Keep track of any foreach loops we are within.
private SmallVector<llvm::DefsetRecord*, 2> Defsets
private llvm::MultiClass* CurMultiClass
CurMultiClass - If we are parsing a 'multiclass' definition, this is the current value.
private std::unique_ptr<TGLocalVarScope> CurLocalScope
CurLocalScope - Innermost of the current nested scopes for 'defvar' local variables.
private llvm::RecordKeeper& Records
private bool NoWarnOnUnusedTemplateArgs = false

Method Overview

  • private bool AddSubClass(llvm::RecordsEntry & Entry, llvm::SubClassReference & SubClass)
  • private bool AddSubClass(llvm::Record * Rec, llvm::SubClassReference & SubClass)
  • private bool AddSubMultiClass(llvm::MultiClass * CurMC, llvm::SubMultiClassReference & SubMultiClass)
  • private bool AddValue(llvm::Record * TheRec, llvm::SMLoc Loc, const llvm::RecordVal & RV)
  • private bool ApplyLetStack(llvm::RecordsEntry & Entry)
  • private bool ApplyLetStack(llvm::Record * CurRec)
  • private bool CheckTemplateArgValues(SmallVectorImpl<llvm::Init *> & Values, llvm::SMLoc Loc, llvm::Record * ArgsRec)
  • public bool Error(llvm::SMLoc L, const llvm::Twine & Msg) const
  • private bool ParseAssert(llvm::MultiClass * CurMultiClass, llvm::Record * CurRec = nullptr)
  • private bool ParseBody(llvm::Record * CurRec)
  • private bool ParseBodyItem(llvm::Record * CurRec)
  • private bool ParseClass()
  • private llvm::Record * ParseClassID()
  • private void ParseDagArgList(SmallVectorImpl<std::pair<llvm::Init *, StringInit *>> & Result, llvm::Record * CurRec)
  • private llvm::Init * ParseDeclaration(llvm::Record * CurRec, bool ParsingTemplateArgs)
  • private bool ParseDef(llvm::MultiClass * CurMultiClass)
  • private bool ParseDefm(llvm::MultiClass * CurMultiClass)
  • private bool ParseDefset()
  • private bool ParseDefvar()
  • public bool ParseFile()
  • private bool ParseForeach(llvm::MultiClass * CurMultiClass)
  • private llvm::VarInit * ParseForeachDeclaration(llvm::Init *& ForeachListValue)
  • private llvm::Init * ParseIDValue(llvm::Record * CurRec, llvm::StringInit * Name, llvm::SMLoc NameLoc, llvm::TGParser::IDParseMode Mode = ParseValueMode)
  • private bool ParseIf(llvm::MultiClass * CurMultiClass)
  • private bool ParseIfBody(llvm::MultiClass * CurMultiClass, llvm::StringRef Kind)
  • private void ParseLetList(SmallVectorImpl<llvm::LetRecord> & Result)
  • private bool ParseMultiClass()
  • private llvm::MultiClass * ParseMultiClassID()
  • private bool ParseObject(llvm::MultiClass * MC)
  • private bool ParseObjectBody(llvm::Record * CurRec)
  • private bool ParseObjectList(llvm::MultiClass * MC = nullptr)
  • private llvm::Init * ParseObjectName(llvm::MultiClass * CurMultiClass)
  • private llvm::Init * ParseOperation(llvm::Record * CurRec, llvm::RecTy * ItemType)
  • private llvm::Init * ParseOperationCond(llvm::Record * CurRec, llvm::RecTy * ItemType)
  • private llvm::Init * ParseOperationFind(llvm::Record * CurRec, llvm::RecTy * ItemType)
  • private llvm::Init * ParseOperationForEachFilter(llvm::Record * CurRec, llvm::RecTy * ItemType)
  • private llvm::Init * ParseOperationSubstr(llvm::Record * CurRec, llvm::RecTy * ItemType)
  • private llvm::RecTy * ParseOperatorType()
  • private bool ParseOptionalBitList(SmallVectorImpl<unsigned int> & Ranges)
  • private bool ParseOptionalRangeList(SmallVectorImpl<unsigned int> & Ranges)
  • private void ParseRangeList(SmallVectorImpl<unsigned int> & Result)
  • private bool ParseRangePiece(SmallVectorImpl<unsigned int> & Ranges, llvm::TypedInit * FirstItem = nullptr)
  • private llvm::Init * ParseSimpleValue(llvm::Record * CurRec, llvm::RecTy * ItemType = nullptr, llvm::TGParser::IDParseMode Mode = ParseValueMode)
  • private llvm::SubClassReference ParseSubClassReference(llvm::Record * CurRec, bool isDefm)
  • private llvm::SubMultiClassReference ParseSubMultiClassReference(llvm::MultiClass * CurMC)
  • private bool ParseTemplateArgList(llvm::Record * CurRec)
  • private bool ParseTemplateArgValueList(SmallVectorImpl<llvm::Init *> & Result, llvm::Record * CurRec, llvm::Record * ArgsRec)
  • private bool ParseTopLevelLet(llvm::MultiClass * CurMultiClass)
  • private llvm::RecTy * ParseType()
  • private llvm::Init * ParseValue(llvm::Record * CurRec, llvm::RecTy * ItemType = nullptr, llvm::TGParser::IDParseMode Mode = ParseValueMode)
  • private void ParseValueList(SmallVectorImpl<llvm::Init *> & Result, llvm::Record * CurRec, llvm::RecTy * ItemType = nullptr)
  • public void PopLocalScope(llvm::TGLocalVarScope * ExpectedStackTop)
  • public llvm::TGLocalVarScope * PushLocalScope()
  • private bool SetValue(llvm::Record * TheRec, llvm::SMLoc Loc, llvm::Init * ValName, ArrayRef<unsigned int> BitList, llvm::Init * V, bool AllowSelfAssignment = false)
  • public TGParser(llvm::SourceMgr & SM, ArrayRef<std::string> Macros, llvm::RecordKeeper & records, const bool NoWarnOnUnusedTemplateArgs = false)
  • public bool TokError(const llvm::Twine & Msg) const
  • private bool addDefOne(std::unique_ptr<Record> Rec)
  • private bool addEntry(llvm::RecordsEntry E)
  • private bool consume(tgtok::TokKind K)
  • public const TGLexer::DependenciesSetTy & getDependencies() const
  • private bool resolve(const llvm::ForeachLoop & Loop, llvm::TGParser::SubstStack & Stack, bool Final, std::vector<RecordsEntry> * Dest, llvm::SMLoc * Loc = nullptr)
  • private bool resolve(const std::vector<RecordsEntry> & Source, llvm::TGParser::SubstStack & Substs, bool Final, std::vector<RecordsEntry> * Dest, llvm::SMLoc * Loc = nullptr)

Methods

bool AddSubClass(
    llvm::RecordsEntry& Entry,
    llvm::SubClassReference& SubClass)

Declared at: llvm/lib/TableGen/TGParser.h:205

Parameters

llvm::RecordsEntry& Entry
llvm::SubClassReference& SubClass

bool AddSubClass(
    llvm::Record* Rec,
    llvm::SubClassReference& SubClass)

Declared at: llvm/lib/TableGen/TGParser.h:204

Parameters

llvm::Record* Rec
llvm::SubClassReference& SubClass

bool AddSubMultiClass(
    llvm::MultiClass* CurMC,
    llvm::SubMultiClassReference& SubMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:206

Parameters

llvm::MultiClass* CurMC
llvm::SubMultiClassReference& SubMultiClass

bool AddValue(llvm::Record* TheRec,
              llvm::SMLoc Loc,
              const llvm::RecordVal& RV)

Declared at: llvm/lib/TableGen/TGParser.h:200

Parameters

llvm::Record* TheRec
llvm::SMLoc Loc
const llvm::RecordVal& RV

bool ApplyLetStack(llvm::RecordsEntry& Entry)

Declared at: llvm/lib/TableGen/TGParser.h:276

Parameters

llvm::RecordsEntry& Entry

bool ApplyLetStack(llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:275

Parameters

llvm::Record* CurRec

bool CheckTemplateArgValues(
    SmallVectorImpl<llvm::Init*>& Values,
    llvm::SMLoc Loc,
    llvm::Record* ArgsRec)

Declared at: llvm/lib/TableGen/TGParser.h:277

Parameters

SmallVectorImpl<llvm::Init*>& Values
llvm::SMLoc Loc
llvm::Record* ArgsRec

bool Error(llvm::SMLoc L,
           const llvm::Twine& Msg) const

Declared at: llvm/lib/TableGen/TGParser.h:175

Parameters

llvm::SMLoc L
const llvm::Twine& Msg

bool ParseAssert(llvm::MultiClass* CurMultiClass,
                 llvm::Record* CurRec = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:232

Parameters

llvm::MultiClass* CurMultiClass
llvm::Record* CurRec = nullptr

bool ParseBody(llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:237

Parameters

llvm::Record* CurRec

bool ParseBodyItem(llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:238

Parameters

llvm::Record* CurRec

bool ParseClass()

Declared at: llvm/lib/TableGen/TGParser.h:223

llvm::Record* ParseClassID()

Declared at: llvm/lib/TableGen/TGParser.h:273

void ParseDagArgList(
    SmallVectorImpl<
        std::pair<llvm::Init*, StringInit*>>&
        Result,
    llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:257

Parameters

SmallVectorImpl< std::pair<llvm::Init*, StringInit*>>& Result
llvm::Record* CurRec

llvm::Init* ParseDeclaration(
    llvm::Record* CurRec,
    bool ParsingTemplateArgs)

Declared at: llvm/lib/TableGen/TGParser.h:241

Parameters

llvm::Record* CurRec
bool ParsingTemplateArgs

bool ParseDef(llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:226

Parameters

llvm::MultiClass* CurMultiClass

bool ParseDefm(llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:225

Parameters

llvm::MultiClass* CurMultiClass

bool ParseDefset()

Declared at: llvm/lib/TableGen/TGParser.h:227

bool ParseDefvar()

Declared at: llvm/lib/TableGen/TGParser.h:228

bool ParseFile()

Description

ParseFile - Main entrypoint for parsing a tblgen file. These parser routines return true on error, or false on success.

Declared at: llvm/lib/TableGen/TGParser.h:173

bool ParseForeach(llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:229

Parameters

llvm::MultiClass* CurMultiClass

llvm::VarInit* ParseForeachDeclaration(
    llvm::Init*& ForeachListValue)

Declared at: llvm/lib/TableGen/TGParser.h:242

Parameters

llvm::Init*& ForeachListValue

llvm::Init* ParseIDValue(
    llvm::Record* CurRec,
    llvm::StringInit* Name,
    llvm::SMLoc NameLoc,
    llvm::TGParser::IDParseMode Mode =
        ParseValueMode)

Declared at: llvm/lib/TableGen/TGParser.h:247

Parameters

llvm::Record* CurRec
llvm::StringInit* Name
llvm::SMLoc NameLoc
llvm::TGParser::IDParseMode Mode = ParseValueMode

bool ParseIf(llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:230

Parameters

llvm::MultiClass* CurMultiClass

bool ParseIfBody(llvm::MultiClass* CurMultiClass,
                 llvm::StringRef Kind)

Declared at: llvm/lib/TableGen/TGParser.h:231

Parameters

llvm::MultiClass* CurMultiClass
llvm::StringRef Kind

void ParseLetList(
    SmallVectorImpl<llvm::LetRecord>& Result)

Declared at: llvm/lib/TableGen/TGParser.h:234

Parameters

SmallVectorImpl<llvm::LetRecord>& Result

bool ParseMultiClass()

Declared at: llvm/lib/TableGen/TGParser.h:224

llvm::MultiClass* ParseMultiClassID()

Declared at: llvm/lib/TableGen/TGParser.h:274

bool ParseObject(llvm::MultiClass* MC)

Declared at: llvm/lib/TableGen/TGParser.h:222

Parameters

llvm::MultiClass* MC

bool ParseObjectBody(llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:236

Parameters

llvm::Record* CurRec

bool ParseObjectList(
    llvm::MultiClass* MC = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:221

Parameters

llvm::MultiClass* MC = nullptr

llvm::Init* ParseObjectName(
    llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:272

Parameters

llvm::MultiClass* CurMultiClass

llvm::Init* ParseOperation(llvm::Record* CurRec,
                           llvm::RecTy* ItemType)

Declared at: llvm/lib/TableGen/TGParser.h:266

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType

llvm::Init* ParseOperationCond(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType)

Declared at: llvm/lib/TableGen/TGParser.h:270

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType

llvm::Init* ParseOperationFind(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType)

Declared at: llvm/lib/TableGen/TGParser.h:268

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType

llvm::Init* ParseOperationForEachFilter(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType)

Declared at: llvm/lib/TableGen/TGParser.h:269

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType

llvm::Init* ParseOperationSubstr(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType)

Declared at: llvm/lib/TableGen/TGParser.h:267

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType

llvm::RecTy* ParseOperatorType()

Declared at: llvm/lib/TableGen/TGParser.h:271

bool ParseOptionalBitList(
    SmallVectorImpl<unsigned int>& Ranges)

Declared at: llvm/lib/TableGen/TGParser.h:261

Parameters

SmallVectorImpl<unsigned int>& Ranges

bool ParseOptionalRangeList(
    SmallVectorImpl<unsigned int>& Ranges)

Declared at: llvm/lib/TableGen/TGParser.h:260

Parameters

SmallVectorImpl<unsigned int>& Ranges

void ParseRangeList(
    SmallVectorImpl<unsigned int>& Result)

Declared at: llvm/lib/TableGen/TGParser.h:262

Parameters

SmallVectorImpl<unsigned int>& Result

bool ParseRangePiece(
    SmallVectorImpl<unsigned int>& Ranges,
    llvm::TypedInit* FirstItem = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:263

Parameters

SmallVectorImpl<unsigned int>& Ranges
llvm::TypedInit* FirstItem = nullptr

llvm::Init* ParseSimpleValue(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType = nullptr,
    llvm::TGParser::IDParseMode Mode =
        ParseValueMode)

Declared at: llvm/lib/TableGen/TGParser.h:249

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType = nullptr
llvm::TGParser::IDParseMode Mode = ParseValueMode

llvm::SubClassReference ParseSubClassReference(
    llvm::Record* CurRec,
    bool isDefm)

Declared at: llvm/lib/TableGen/TGParser.h:244

Parameters

llvm::Record* CurRec
bool isDefm

llvm::SubMultiClassReference
ParseSubMultiClassReference(
    llvm::MultiClass* CurMC)

Declared at: llvm/lib/TableGen/TGParser.h:245

Parameters

llvm::MultiClass* CurMC

bool ParseTemplateArgList(llvm::Record* CurRec)

Declared at: llvm/lib/TableGen/TGParser.h:240

Parameters

llvm::Record* CurRec

bool ParseTemplateArgValueList(
    SmallVectorImpl<llvm::Init*>& Result,
    llvm::Record* CurRec,
    llvm::Record* ArgsRec)

Declared at: llvm/lib/TableGen/TGParser.h:255

Parameters

SmallVectorImpl<llvm::Init*>& Result
llvm::Record* CurRec
llvm::Record* ArgsRec

bool ParseTopLevelLet(
    llvm::MultiClass* CurMultiClass)

Declared at: llvm/lib/TableGen/TGParser.h:233

Parameters

llvm::MultiClass* CurMultiClass

llvm::RecTy* ParseType()

Declared at: llvm/lib/TableGen/TGParser.h:265

llvm::Init* ParseValue(
    llvm::Record* CurRec,
    llvm::RecTy* ItemType = nullptr,
    llvm::TGParser::IDParseMode Mode =
        ParseValueMode)

Declared at: llvm/lib/TableGen/TGParser.h:251

Parameters

llvm::Record* CurRec
llvm::RecTy* ItemType = nullptr
llvm::TGParser::IDParseMode Mode = ParseValueMode

void ParseValueList(
    SmallVectorImpl<llvm::Init*>& Result,
    llvm::Record* CurRec,
    llvm::RecTy* ItemType = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:253

Parameters

SmallVectorImpl<llvm::Init*>& Result
llvm::Record* CurRec
llvm::RecTy* ItemType = nullptr

void PopLocalScope(
    llvm::TGLocalVarScope* ExpectedStackTop)

Declared at: llvm/lib/TableGen/TGParser.h:193

Parameters

llvm::TGLocalVarScope* ExpectedStackTop

llvm::TGLocalVarScope* PushLocalScope()

Declared at: llvm/lib/TableGen/TGParser.h:186

bool SetValue(llvm::Record* TheRec,
              llvm::SMLoc Loc,
              llvm::Init* ValName,
              ArrayRef<unsigned int> BitList,
              llvm::Init* V,
              bool AllowSelfAssignment = false)

Declared at: llvm/lib/TableGen/TGParser.h:201

Parameters

llvm::Record* TheRec
llvm::SMLoc Loc
llvm::Init* ValName
ArrayRef<unsigned int> BitList
llvm::Init* V
bool AllowSelfAssignment = false

TGParser(
    llvm::SourceMgr& SM,
    ArrayRef<std::string> Macros,
    llvm::RecordKeeper& records,
    const bool NoWarnOnUnusedTemplateArgs = false)

Declared at: llvm/lib/TableGen/TGParser.h:166

Parameters

llvm::SourceMgr& SM
ArrayRef<std::string> Macros
llvm::RecordKeeper& records
const bool NoWarnOnUnusedTemplateArgs = false

bool TokError(const llvm::Twine& Msg) const

Declared at: llvm/lib/TableGen/TGParser.h:179

Parameters

const llvm::Twine& Msg

bool addDefOne(std::unique_ptr<Record> Rec)

Declared at: llvm/lib/TableGen/TGParser.h:217

Parameters

std::unique_ptr<Record> Rec

bool addEntry(llvm::RecordsEntry E)

Declared at: llvm/lib/TableGen/TGParser.h:211

Parameters

llvm::RecordsEntry E

bool consume(tgtok::TokKind K)

Declared at: llvm/lib/TableGen/TGParser.h:220

Parameters

tgtok::TokKind K

const TGLexer::DependenciesSetTy&
getDependencies() const

Declared at: llvm/lib/TableGen/TGParser.h:182

bool resolve(const llvm::ForeachLoop& Loop,
             llvm::TGParser::SubstStack& Stack,
             bool Final,
             std::vector<RecordsEntry>* Dest,
             llvm::SMLoc* Loc = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:212

Parameters

const llvm::ForeachLoop& Loop
llvm::TGParser::SubstStack& Stack
bool Final
std::vector<RecordsEntry>* Dest
llvm::SMLoc* Loc = nullptr

bool resolve(
    const std::vector<RecordsEntry>& Source,
    llvm::TGParser::SubstStack& Substs,
    bool Final,
    std::vector<RecordsEntry>* Dest,
    llvm::SMLoc* Loc = nullptr)

Declared at: llvm/lib/TableGen/TGParser.h:214

Parameters

const std::vector<RecordsEntry>& Source
llvm::TGParser::SubstStack& Substs
bool Final
std::vector<RecordsEntry>* Dest
llvm::SMLoc* Loc = nullptr