LLVM 20.0.0git
|
MCTargetAsmParser - Generic interface to target specific assembly parsers. More...
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
Public Types | |
enum | MatchResultTy { Match_InvalidOperand , Match_InvalidTiedOperand , Match_MissingFeature , Match_MnemonicFail , Match_Success , Match_NearMisses , FIRST_TARGET_MATCH_RESULT_TY } |
Protected Member Functions | |
MCTargetAsmParser (MCTargetOptions const &, const MCSubtargetInfo &STI, const MCInstrInfo &MII) | |
MCSubtargetInfo & | copySTI () |
Create a copy of STI and return a non-const reference to it. | |
Protected Member Functions inherited from llvm::MCAsmParserExtension | |
MCAsmParserExtension () | |
Protected Attributes | |
FeatureBitset | AvailableFeatures |
AvailableFeatures - The current set of available features. | |
bool | ParsingMSInlineAsm = false |
ParsingMSInlineAsm - Are we parsing ms-style inline assembly? | |
MCAsmParserSemaCallback * | SemaCallback = nullptr |
SemaCallback - The Sema callback implementation. | |
MCTargetOptions | MCOptions |
Set of options which affects instrumentation of inline assembly. | |
const MCSubtargetInfo * | STI |
Current STI. | |
const MCInstrInfo & | MII |
Protected Attributes inherited from llvm::MCAsmParserExtension | |
bool | BracketExpressionsSupported = false |
Additional Inherited Members | |
Static Protected Member Functions inherited from llvm::MCAsmParserExtension | |
template<typename T , bool(T::*)(StringRef, SMLoc) Handler> | |
static bool | HandleDirective (MCAsmParserExtension *Target, StringRef Directive, SMLoc DirectiveLoc) |
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Definition at line 352 of file MCTargetAsmParser.h.
Enumerator | |
---|---|
Match_InvalidOperand | |
Match_InvalidTiedOperand | |
Match_MissingFeature | |
Match_MnemonicFail | |
Match_Success | |
Match_NearMisses | |
FIRST_TARGET_MATCH_RESULT_TY |
Definition at line 354 of file MCTargetAsmParser.h.
|
protected |
Definition at line 15 of file MCTargetAsmParser.cpp.
|
delete |
|
overridedefault |
|
inlinevirtual |
Definition at line 530 of file MCTargetAsmParser.h.
|
virtual |
Returns whether two operands are registers and are equal.
This is used by the tied-operands checks in the AsmMatcher. This method can be overridden to allow e.g. a sub- or super-register as the tied operand.
Definition at line 53 of file MCTargetAsmParser.cpp.
References llvm::MCParsedAsmOperand::getReg(), and llvm::MCParsedAsmOperand::isReg().
|
inlinevirtual |
Validate the instruction match against any complex target predicates before rendering any operands to it.
Definition at line 500 of file MCTargetAsmParser.h.
References Match_Success.
checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not expressible via match classes.
Definition at line 506 of file MCTargetAsmParser.h.
References Match_Success.
|
pure virtual |
|
protected |
Create a copy of STI and return a non-const reference to it.
Definition at line 22 of file MCTargetAsmParser.cpp.
References llvm::MCAsmParserExtension::getContext(), getSTI(), llvm::MCContext::getSubtargetCopy(), and STI.
|
inlinevirtual |
Definition at line 545 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 537 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 520 of file MCTargetAsmParser.h.
|
inlinevirtual |
Ensure that all previously parsed instructions have been emitted to the output streamer, if the target does not emit them immediately.
Definition at line 543 of file MCTargetAsmParser.h.
|
inline |
Definition at line 397 of file MCTargetAsmParser.h.
References AvailableFeatures.
const MCSubtargetInfo & MCTargetAsmParser::getSTI | ( | ) | const |
|
inline |
Definition at line 407 of file MCTargetAsmParser.h.
References MCOptions.
|
inlinevirtual |
Definition at line 527 of file MCTargetAsmParser.h.
References llvm::MCSymbolRefExpr::getVariantKindForName(), and Name.
Definition at line 522 of file MCTargetAsmParser.h.
|
inline |
Definition at line 404 of file MCTargetAsmParser.h.
References ParsingMSInlineAsm.
|
pure virtual |
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.
|
inlinevirtual |
Allows targets to let registers opt out of clobber lists.
Definition at line 486 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 552 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 555 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 539 of file MCTargetAsmParser.h.
|
delete |
ParseDirective - Parse a target specific assembler directive This method is deprecated, use 'parseDirective' instead.
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.
DirectiveID | - the identifier token of the directive. |
Definition at line 460 of file MCTargetAsmParser.h.
Referenced by parseDirective().
|
virtual |
Parses 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 emit an error. On success, the entire line should be parsed up to and including the end-of-statement token. On failure, the parser is not required to read to the end of the line. If the directive is not target-specific, no tokens should be consumed and NoMatch is returned.
DirectiveID | - The token identifying the directive. |
Definition at line 32 of file MCTargetAsmParser.cpp.
References llvm::ParseStatus::Failure, llvm::AsmToken::getLoc(), llvm::MCAsmParserExtension::getParser(), llvm::MCAsmParserExtension::getTok(), llvm::ParseStatus::NoMatch, ParseDirective(), and llvm::ParseStatus::Success.
|
inlinevirtual |
Definition at line 444 of file MCTargetAsmParser.h.
References llvm::AsmToken::getLoc(), Info, Name, Operands, and parseInstruction().
|
pure virtual |
Parse one assembly instruction.
The parser is positioned following the instruction name. The target specific instruction parser should parse the entire instruction and construct the appropriate MCInst, or emit an error. On success, the entire line should be parsed up to and including the end-of-statement token. On failure, the parser is not required to read to the end of the line.
Name | - The instruction name. |
NameLoc | - The source location of the name. |
Operands | [out] - The list of parsed operands, this returns ownership of them to the caller. |
Referenced by parseInstruction().
|
inlinevirtual |
Definition at line 414 of file MCTargetAsmParser.h.
References llvm::MCAsmParserExtension::getParser(), and llvm::MCAsmParser::parsePrimaryExpr().
|
pure virtual |
|
inline |
Definition at line 400 of file MCTargetAsmParser.h.
References AvailableFeatures.
Referenced by XtensaAsmParser::XtensaAsmParser().
|
inline |
Definition at line 405 of file MCTargetAsmParser.h.
References ParsingMSInlineAsm.
|
inline |
Definition at line 409 of file MCTargetAsmParser.h.
References SemaCallback.
|
inlinevirtual |
Definition at line 524 of file MCTargetAsmParser.h.
|
pure virtual |
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.
|
inlinevirtual |
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.
Definition at line 492 of file MCTargetAsmParser.h.
References Match_InvalidOperand.
|
protected |
AvailableFeatures - The current set of available features.
Definition at line 372 of file MCTargetAsmParser.h.
Referenced by getAvailableFeatures(), and setAvailableFeatures().
|
protected |
Set of options which affects instrumentation of inline assembly.
Definition at line 382 of file MCTargetAsmParser.h.
Referenced by getTargetOptions().
|
protected |
Definition at line 387 of file MCTargetAsmParser.h.
|
protected |
ParsingMSInlineAsm - Are we parsing ms-style inline assembly?
Definition at line 375 of file MCTargetAsmParser.h.
Referenced by isParsingMSInlineAsm(), and setParsingMSInlineAsm().
|
protected |
SemaCallback - The Sema callback implementation.
Must be set when parsing ms-style inline assembly.
Definition at line 379 of file MCTargetAsmParser.h.
Referenced by setSemaCallback().
|
protected |
Current STI.
Definition at line 385 of file MCTargetAsmParser.h.
Referenced by copySTI(), getSTI(), and XtensaAsmParser::XtensaAsmParser().