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:310
Inherits from: MCAsmParserExtension
Member Variables
- protected llvm::FeatureBitset AvailableFeatures
- AvailableFeatures - The current set of available features.
- protected bool ParsingInlineAsm = false
- ParsingInlineAsm - Are we parsing ms-style inline assembly?
- protected llvm::MCAsmParserSemaCallback* SemaCallback
- 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:
Method Overview
- protected MCTargetAsmParser(const llvm::MCTargetOptions &, const llvm::MCSubtargetInfo & STI, const llvm::MCInstrInfo & MII)
- public MCTargetAsmParser(const llvm::MCTargetAsmParser &)
- public virtual bool MatchAndEmitInstruction(llvm::SMLoc IDLoc, unsigned int & Opcode, llvm::OperandVector & Operands, llvm::MCStreamer & Out, uint64_t & ErrorInfo, bool MatchingInlineAsm)
- public virtual bool OmitRegisterFromClobberLists(unsigned int RegNo)
- public virtual bool ParseDirective(llvm::AsmToken DirectiveID)
- public virtual bool ParseInstruction(llvm::ParseInstructionInfo & Info, llvm::StringRef Name, llvm::AsmToken Token, llvm::OperandVector & Operands)
- public virtual bool ParseInstruction(llvm::ParseInstructionInfo & Info, llvm::StringRef Name, llvm::SMLoc NameLoc, llvm::OperandVector & Operands)
- public virtual bool ParseRegister(unsigned int & RegNo, llvm::SMLoc & StartLoc, llvm::SMLoc & EndLoc)
- public virtual const llvm::MCExpr * applyModifierToExpr(const llvm::MCExpr * E, MCSymbolRefExpr::VariantKind, llvm::MCContext & Ctx)
- public virtual unsigned int checkEarlyTargetMatchPredicate(llvm::MCInst & Inst, const llvm::OperandVector & Operands)
- public virtual unsigned int checkTargetMatchPredicate(llvm::MCInst & Inst)
- public virtual void convertToMapAndConstraints(unsigned int Kind, const llvm::OperandVector & Operands)
- protected llvm::MCSubtargetInfo & copySTI()
- public virtual const llvm::MCExpr * createTargetUnaryExpr(const llvm::MCExpr * E, AsmToken::TokenKind OperatorToken, llvm::MCContext & Ctx)
- public virtual void doBeforeLabelEmit(llvm::MCSymbol * Symbol)
- public virtual bool equalIsAsmAssignment()
- public virtual void flushPendingInstructions(llvm::MCStreamer & Out)
- public const llvm::FeatureBitset & getAvailableFeatures() const
- public const llvm::MCSubtargetInfo & getSTI() const
- public llvm::MCTargetOptions getTargetOptions() const
- public virtual bool isLabel(llvm::AsmToken & Token)
- public bool isParsingInlineAsm()
- public virtual void onEndOfFile()
- public virtual void onLabelParsed(llvm::MCSymbol * Symbol)
- public virtual bool parsePrimaryExpr(const llvm::MCExpr *& Res, llvm::SMLoc & EndLoc)
- public virtual bool regsEqual(const llvm::MCParsedAsmOperand & Op1, const llvm::MCParsedAsmOperand & Op2) const
- public void setAvailableFeatures(const llvm::FeatureBitset & Value)
- public void setParsingInlineAsm(bool Value)
- public void setSemaCallback(llvm::MCAsmParserSemaCallback * Callback)
- public virtual bool starIsStartOfStatement()
- public virtual unsigned int validateTargetOperandClass(llvm::MCParsedAsmOperand & Op, unsigned int Kind)
- public ~MCTargetAsmParser()
Inherited from MCAsmParserExtension:
- public Error
- protected HandleDirective
- public HasBracketExpressions
- public Initialize
- public Lex
- public Note
- public TokError
- public Warning
- public addErrorSuffix
- public check
- public check
- public getContext
- public getLexer
- public getLexer
- public getParser
- public getParser
- public getSourceManager
- public getStreamer
- public getTok
- public parseMany
- public parseOptionalToken
- public parseToken
Methods
¶MCTargetAsmParser(
const llvm::MCTargetOptions&,
const llvm::MCSubtargetInfo& STI,
const llvm::MCInstrInfo& MII)
MCTargetAsmParser(
const llvm::MCTargetOptions&,
const llvm::MCSubtargetInfo& STI,
const llvm::MCInstrInfo& MII)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:323
Parameters
- const llvm::MCTargetOptions&
- const llvm::MCSubtargetInfo& STI
- const llvm::MCInstrInfo& MII
¶MCTargetAsmParser(const llvm::MCTargetAsmParser&)
MCTargetAsmParser(const llvm::MCTargetAsmParser&)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:348
Parameters
- const llvm::MCTargetAsmParser&
¶virtual bool MatchAndEmitInstruction(
llvm::SMLoc IDLoc,
unsigned int& Opcode,
llvm::OperandVector& Operands,
llvm::MCStreamer& Out,
uint64_t& ErrorInfo,
bool MatchingInlineAsm)
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:417
Parameters
- llvm::SMLoc IDLoc
- unsigned int& Opcode
- llvm::OperandVector& Operands
- llvm::MCStreamer& Out
- uint64_t& ErrorInfo
- bool MatchingInlineAsm
¶virtual bool OmitRegisterFromClobberLists(
unsigned int RegNo)
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:423
Parameters
- unsigned int RegNo
¶virtual bool ParseDirective(
llvm::AsmToken DirectiveID)
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:409
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)
virtual bool ParseInstruction(
llvm::ParseInstructionInfo& Info,
llvm::StringRef Name,
llvm::AsmToken Token,
llvm::OperandVector& Operands)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:394
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)
virtual bool ParseInstruction(
llvm::ParseInstructionInfo& Info,
llvm::StringRef Name,
llvm::SMLoc NameLoc,
llvm::OperandVector& Operands)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:392
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)
virtual bool ParseRegister(unsigned int& RegNo,
llvm::SMLoc& StartLoc,
llvm::SMLoc& EndLoc)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:376
Parameters
- unsigned int& RegNo
- llvm::SMLoc& StartLoc
- llvm::SMLoc& EndLoc
¶virtual const llvm::MCExpr* applyModifierToExpr(
const llvm::MCExpr* E,
MCSymbolRefExpr::VariantKind,
llvm::MCContext& Ctx)
virtual const llvm::MCExpr* applyModifierToExpr(
const llvm::MCExpr* E,
MCSymbolRefExpr::VariantKind,
llvm::MCContext& Ctx)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:466
Parameters
- const llvm::MCExpr* E
- MCSymbolRefExpr::VariantKind
- llvm::MCContext& Ctx
¶virtual unsigned int
checkEarlyTargetMatchPredicate(
llvm::MCInst& Inst,
const llvm::OperandVector& Operands)
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:437
Parameters
- llvm::MCInst& Inst
- const llvm::OperandVector& Operands
¶virtual unsigned int checkTargetMatchPredicate(
llvm::MCInst& Inst)
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:443
Parameters
- llvm::MCInst& Inst
¶virtual void convertToMapAndConstraints(
unsigned int Kind,
const llvm::OperandVector& Operands)
virtual void convertToMapAndConstraints(
unsigned int Kind,
const llvm::OperandVector& Operands)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:447
Parameters
- unsigned int Kind
- const llvm::OperandVector& Operands
¶llvm::MCSubtargetInfo& copySTI()
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:327
¶virtual const llvm::MCExpr* createTargetUnaryExpr(
const llvm::MCExpr* E,
AsmToken::TokenKind OperatorToken,
llvm::MCContext& Ctx)
virtual const llvm::MCExpr* createTargetUnaryExpr(
const llvm::MCExpr* E,
AsmToken::TokenKind OperatorToken,
llvm::MCContext& Ctx)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:481
Parameters
- const llvm::MCExpr* E
- AsmToken::TokenKind OperatorToken
- llvm::MCContext& Ctx
¶virtual void doBeforeLabelEmit(
llvm::MCSymbol* Symbol)
virtual void doBeforeLabelEmit(
llvm::MCSymbol* Symbol)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:473
Parameters
- llvm::MCSymbol* Symbol
¶virtual bool equalIsAsmAssignment()
virtual bool equalIsAsmAssignment()
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:460
¶virtual void flushPendingInstructions(
llvm::MCStreamer& Out)
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:479
Parameters
- llvm::MCStreamer& Out
¶const llvm::FeatureBitset& getAvailableFeatures()
const
const llvm::FeatureBitset& getAvailableFeatures()
const
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:355
¶const llvm::MCSubtargetInfo& getSTI() const
const llvm::MCSubtargetInfo& getSTI() const
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:353
¶llvm::MCTargetOptions getTargetOptions() const
llvm::MCTargetOptions getTargetOptions() const
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:365
¶virtual bool isLabel(llvm::AsmToken& Token)
virtual bool isLabel(llvm::AsmToken& Token)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:462
Parameters
- llvm::AsmToken& Token
¶bool isParsingInlineAsm()
bool isParsingInlineAsm()
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:362
¶virtual void onEndOfFile()
virtual void onEndOfFile()
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:488
¶virtual void onLabelParsed(llvm::MCSymbol* Symbol)
virtual void onLabelParsed(llvm::MCSymbol* Symbol)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:475
Parameters
- llvm::MCSymbol* Symbol
¶virtual bool parsePrimaryExpr(
const llvm::MCExpr*& Res,
llvm::SMLoc& EndLoc)
virtual bool parsePrimaryExpr(
const llvm::MCExpr*& Res,
llvm::SMLoc& EndLoc)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:372
Parameters
- const llvm::MCExpr*& Res
- llvm::SMLoc& EndLoc
¶virtual bool regsEqual(
const llvm::MCParsedAsmOperand& Op1,
const llvm::MCParsedAsmOperand& Op2) const
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:453
Parameters
- const llvm::MCParsedAsmOperand& Op1
- const llvm::MCParsedAsmOperand& Op2
¶void setAvailableFeatures(
const llvm::FeatureBitset& Value)
void setAvailableFeatures(
const llvm::FeatureBitset& Value)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:358
Parameters
- const llvm::FeatureBitset& Value
¶void setParsingInlineAsm(bool Value)
void setParsingInlineAsm(bool Value)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:363
Parameters
- bool Value
¶void setSemaCallback(
llvm::MCAsmParserSemaCallback* Callback)
void setSemaCallback(
llvm::MCAsmParserSemaCallback* Callback)
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:367
Parameters
- llvm::MCAsmParserSemaCallback* Callback
¶virtual bool starIsStartOfStatement()
virtual bool starIsStartOfStatement()
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:464
¶virtual unsigned int validateTargetOperandClass(
llvm::MCParsedAsmOperand& Op,
unsigned int Kind)
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:429
Parameters
- llvm::MCParsedAsmOperand& Op
- unsigned int Kind
¶~MCTargetAsmParser()
~MCTargetAsmParser()
Declared at: llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h:351