class MCTargetAsmParser

Declaration

class MCTargetAsmParser : public MCAsmParserExtension { /* full declaration omitted */ };

Description

MCTargetAsmParser - Generic interface to target specific assembly parsers.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:314

Inherits from: MCAsmParserExtension

Member Variables

protected llvm::FeatureBitset AvailableFeatures
AvailableFeatures - The current set of available features.
protected bool ParsingMSInlineAsm = false
ParsingMSInlineAsm - Are we parsing ms-style inline assembly?
protected llvm::MCAsmParserSemaCallback* SemaCallback = nullptr
SemaCallback - The Sema callback implementation. Must be set when parsing ms-style inline assembly.
protected llvm::MCTargetOptions MCOptions
Set of options which affects instrumentation of inline assembly.
protected const llvm::MCSubtargetInfo* STI
Current STI.
protected const llvm::MCInstrInfo& MII

Inherited from MCAsmParserExtension:

protected BracketExpressionsSupported = false

Method Overview

Inherited from MCAsmParserExtension:

Methods

MCTargetAsmParser(
    const llvm::MCTargetOptions&,
    const llvm::MCSubtargetInfo& STI,
    const llvm::MCInstrInfo& MII)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:327

Parameters

const llvm::MCTargetOptions&
const llvm::MCSubtargetInfo& STI
const llvm::MCInstrInfo& MII

MCTargetAsmParser(const llvm::MCTargetAsmParser&)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:352

Parameters

const llvm::MCTargetAsmParser&

virtual bool MatchAndEmitInstruction(
    llvm::SMLoc IDLoc,
    unsigned int& Opcode,
    llvm::OperandVector& Operands,
    llvm::MCStreamer& Out,
    uint64_t& ErrorInfo,
    bool MatchingInlineAsm)

Description

MatchAndEmitInstruction - Recognize a series of operands of a parsed instruction as an actual MCInst and emit it to the specified MCStreamer. This returns false on success and returns true on failure to match. On failure, the target parser is responsible for emitting a diagnostic explaining the match failure.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:429

Parameters

llvm::SMLoc IDLoc
unsigned int& Opcode
llvm::OperandVector& Operands
llvm::MCStreamer& Out
uint64_t& ErrorInfo
bool MatchingInlineAsm

virtual bool OmitRegisterFromClobberLists(
    unsigned int RegNo)

Description

Allows targets to let registers opt out of clobber lists.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:435

Parameters

unsigned int RegNo

virtual bool ParseDirective(
    llvm::AsmToken DirectiveID)

Description

ParseDirective - Parse a target specific assembler directive The parser is positioned following the directive name. The target specific directive parser should parse the entire directive doing or recording any target specific work, or return true and do nothing if the directive is not target specific. If the directive is specific for the target, the entire line is parsed up to and including the end-of-statement token and false is returned.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:421

Parameters

llvm::AsmToken DirectiveID
- the identifier token of the directive.

virtual bool ParseInstruction(
    llvm::ParseInstructionInfo& Info,
    llvm::StringRef Name,
    llvm::AsmToken Token,
    llvm::OperandVector& Operands)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:406

Parameters

llvm::ParseInstructionInfo& Info
llvm::StringRef Name
llvm::AsmToken Token
llvm::OperandVector& Operands

virtual bool ParseInstruction(
    llvm::ParseInstructionInfo& Info,
    llvm::StringRef Name,
    llvm::SMLoc NameLoc,
    llvm::OperandVector& Operands)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:404

Parameters

llvm::ParseInstructionInfo& Info
llvm::StringRef Name
- The instruction name.
llvm::SMLoc NameLoc
- The source location of the name.
llvm::OperandVector& Operands
[out] - The list of parsed operands, this returns ownership of them to the caller.

Returns

True on failure.

virtual bool ParseRegister(unsigned int& RegNo,
                           llvm::SMLoc& StartLoc,
                           llvm::SMLoc& EndLoc)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:380

Parameters

unsigned int& RegNo
llvm::SMLoc& StartLoc
llvm::SMLoc& EndLoc

virtual const llvm::MCExpr* applyModifierToExpr(
    const llvm::MCExpr* E,
    MCSymbolRefExpr::VariantKind,
    llvm::MCContext& Ctx)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:478

Parameters

const llvm::MCExpr* E
MCSymbolRefExpr::VariantKind
llvm::MCContext& Ctx

virtual unsigned int
checkEarlyTargetMatchPredicate(
    llvm::MCInst& Inst,
    const llvm::OperandVector& Operands)

Description

Validate the instruction match against any complex target predicates before rendering any operands to it.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:449

Parameters

llvm::MCInst& Inst
const llvm::OperandVector& Operands

virtual unsigned int checkTargetMatchPredicate(
    llvm::MCInst& Inst)

Description

checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not expressible via match classes.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:455

Parameters

llvm::MCInst& Inst

virtual void convertToMapAndConstraints(
    unsigned int Kind,
    const llvm::OperandVector& Operands)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:459

Parameters

unsigned int Kind
const llvm::OperandVector& Operands

llvm::MCSubtargetInfo& copySTI()

Description

Create a copy of STI and return a non-const reference to it.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:331

virtual const llvm::MCExpr* createTargetUnaryExpr(
    const llvm::MCExpr* E,
    AsmToken::TokenKind OperatorToken,
    llvm::MCContext& Ctx)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:493

Parameters

const llvm::MCExpr* E
AsmToken::TokenKind OperatorToken
llvm::MCContext& Ctx

virtual void doBeforeLabelEmit(
    llvm::MCSymbol* Symbol)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:485

Parameters

llvm::MCSymbol* Symbol

virtual bool equalIsAsmAssignment()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:472

virtual void flushPendingInstructions(
    llvm::MCStreamer& Out)

Description

Ensure that all previously parsed instructions have been emitted to the output streamer, if the target does not emit them immediately.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:491

Parameters

llvm::MCStreamer& Out

const llvm::FeatureBitset& getAvailableFeatures()
    const

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:359

const llvm::MCSubtargetInfo& getSTI() const

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:357

llvm::MCTargetOptions getTargetOptions() const

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:369

virtual bool isLabel(llvm::AsmToken& Token)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:474

Parameters

llvm::AsmToken& Token

bool isParsingMSInlineAsm()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:366

virtual void onBeginOfFile()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:500

virtual void onEndOfFile()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:503

virtual void onLabelParsed(llvm::MCSymbol* Symbol)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:487

Parameters

llvm::MCSymbol* Symbol

virtual bool parsePrimaryExpr(
    const llvm::MCExpr*& Res,
    llvm::SMLoc& EndLoc)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:376

Parameters

const llvm::MCExpr*& Res
llvm::SMLoc& EndLoc

virtual bool regsEqual(
    const llvm::MCParsedAsmOperand& Op1,
    const llvm::MCParsedAsmOperand& Op2) const

Description

Returns whether two registers are equal and is used by the tied-operands checks in the AsmMatcher. This method can be overridden allow e.g. a sub- or super-register as the tied operand.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:465

Parameters

const llvm::MCParsedAsmOperand& Op1
const llvm::MCParsedAsmOperand& Op2

void setAvailableFeatures(
    const llvm::FeatureBitset& Value)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:362

Parameters

const llvm::FeatureBitset& Value

void setParsingMSInlineAsm(bool Value)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:367

Parameters

bool Value

void setSemaCallback(
    llvm::MCAsmParserSemaCallback* Callback)

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:371

Parameters

llvm::MCAsmParserSemaCallback* Callback

virtual bool starIsStartOfStatement()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:476

virtual llvm::OperandMatchResultTy
tryParseRegister(unsigned int& RegNo,
                 llvm::SMLoc& StartLoc,
                 llvm::SMLoc& EndLoc)

Description

tryParseRegister - parse one register if possible Check whether a register specification can be parsed at the current location, without failing the entire parse if it can't. Must not consume tokens if the parse fails.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:389

Parameters

unsigned int& RegNo
llvm::SMLoc& StartLoc
llvm::SMLoc& EndLoc

virtual unsigned int validateTargetOperandClass(
    llvm::MCParsedAsmOperand& Op,
    unsigned int Kind)

Description

Allow a target to add special case operand matching for things that tblgen doesn't/can't handle effectively. For example, literal immediates on ARM. TableGen expects a token operand, but the parser will recognize them as immediates.

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:441

Parameters

llvm::MCParsedAsmOperand& Op
unsigned int Kind

~MCTargetAsmParser()

Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:355