|
LLVM
4.0.0
|
MCTargetAsmParser - Generic interface to target specific assembly parsers. More...
#include <MCTargetAsmParser.h>
Public Types | |
| enum | MatchResultTy { Match_InvalidOperand, Match_MissingFeature, Match_MnemonicFail, Match_Success, FIRST_TARGET_MATCH_RESULT_TY } |
Public Member Functions | |
| ~MCTargetAsmParser () override | |
| const MCSubtargetInfo & | getSTI () const |
| uint64_t | getAvailableFeatures () const |
| void | setAvailableFeatures (uint64_t Value) |
| bool | isParsingInlineAsm () |
| void | setParsingInlineAsm (bool Value) |
| MCTargetOptions | getTargetOptions () const |
| void | setSemaCallback (MCAsmParserSemaCallback *Callback) |
| virtual bool | ParseRegister (unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc)=0 |
| virtual void | SetFrameRegister (unsigned RegNo) |
| Sets frame register corresponding to the current MachineFunction. More... | |
| virtual bool | ParseInstruction (ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands)=0 |
| ParseInstruction - Parse one assembly instruction. More... | |
| virtual bool | ParseInstruction (ParseInstructionInfo &Info, StringRef Name, AsmToken Token, OperandVector &Operands) |
| virtual bool | ParseDirective (AsmToken DirectiveID)=0 |
| ParseDirective - Parse a target specific assembler directive. More... | |
| virtual bool | MatchAndEmitInstruction (SMLoc IDLoc, unsigned &Opcode, OperandVector &Operands, MCStreamer &Out, uint64_t &ErrorInfo, bool MatchingInlineAsm)=0 |
| MatchAndEmitInstruction - Recognize a series of operands of a parsed instruction as an actual MCInst and emit it to the specified MCStreamer. More... | |
| virtual bool | OmitRegisterFromClobberLists (unsigned RegNo) |
| Allows targets to let registers opt out of clobber lists. More... | |
| virtual unsigned | validateTargetOperandClass (MCParsedAsmOperand &Op, unsigned Kind) |
| Allow a target to add special case operand matching for things that tblgen doesn't/can't handle effectively. More... | |
| virtual unsigned | checkEarlyTargetMatchPredicate (MCInst &Inst, const OperandVector &Operands) |
| Validate the instruction match against any complex target predicates before rendering any operands to it. More... | |
| virtual unsigned | checkTargetMatchPredicate (MCInst &Inst) |
| checkTargetMatchPredicate - Validate the instruction match against any complex target predicates not expressible via match classes. More... | |
| virtual void | convertToMapAndConstraints (unsigned Kind, const OperandVector &Operands)=0 |
| virtual bool | equalIsAsmAssignment () |
| virtual bool | isLabel (AsmToken &Token) |
| virtual const MCExpr * | applyModifierToExpr (const MCExpr *E, MCSymbolRefExpr::VariantKind, MCContext &Ctx) |
| virtual void | onLabelParsed (MCSymbol *Symbol) |
| virtual void | flushPendingInstructions (MCStreamer &Out) |
| Ensure that all previously parsed instructions have been emitted to the output streamer, if the target does not emit them immediately. More... | |
| virtual const MCExpr * | createTargetUnaryExpr (const MCExpr *E, AsmToken::TokenKind OperatorToken, MCContext &Ctx) |
Public Member Functions inherited from llvm::MCAsmParserExtension | |
| virtual | ~MCAsmParserExtension () |
| virtual void | Initialize (MCAsmParser &Parser) |
Initialize the extension for parsing using the given Parser. More... | |
| MCContext & | getContext () |
| MCAsmLexer & | getLexer () |
| const MCAsmLexer & | getLexer () const |
| MCAsmParser & | getParser () |
| const MCAsmParser & | getParser () const |
| SourceMgr & | getSourceManager () |
| MCStreamer & | getStreamer () |
| bool | Warning (SMLoc L, const Twine &Msg) |
| bool | Error (SMLoc L, const Twine &Msg, SMRange Range=SMRange()) |
| void | Note (SMLoc L, const Twine &Msg) |
| bool | TokError (const Twine &Msg) |
| const AsmToken & | Lex () |
| const AsmToken & | getTok () |
| bool | parseToken (AsmToken::TokenKind T, const Twine &Msg="unexpected token") |
| bool | parseMany (std::function< bool()> parseOne, bool hasComma=true) |
| bool | parseOptionalToken (AsmToken::TokenKind T) |
| bool | check (bool P, const llvm::Twine &Msg) |
| bool | check (bool P, SMLoc Loc, const llvm::Twine &Msg) |
| bool | addErrorSuffix (const Twine &Suffix) |
| bool | HasBracketExpressions () const |
Protected Member Functions | |
| MCTargetAsmParser (MCTargetOptions const &, const MCSubtargetInfo &STI) | |
| MCSubtargetInfo & | copySTI () |
| Create a copy of STI and return a non-const reference to it. More... | |
Protected Member Functions inherited from llvm::MCAsmParserExtension | |
| MCAsmParserExtension () | |
Protected Attributes | |
| uint64_t | AvailableFeatures |
| AvailableFeatures - The current set of available features. More... | |
| bool | ParsingInlineAsm |
| ParsingInlineAsm - Are we parsing ms-style inline assembly? More... | |
| MCAsmParserSemaCallback * | SemaCallback |
| SemaCallback - The Sema callback implementation. More... | |
| MCTargetOptions | MCOptions |
| Set of options which affects instrumentation of inline assembly. More... | |
| const MCSubtargetInfo * | STI |
| Current STI. More... | |
Protected Attributes inherited from llvm::MCAsmParserExtension | |
| bool | BracketExpressionsSupported |
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 92 of file MCTargetAsmParser.h.
| Enumerator | |
|---|---|
| Match_InvalidOperand | |
| Match_MissingFeature | |
| Match_MnemonicFail | |
| Match_Success | |
| FIRST_TARGET_MATCH_RESULT_TY | |
Definition at line 94 of file MCTargetAsmParser.h.
|
protected |
Definition at line 14 of file MCTargetAsmParser.cpp.
|
override |
Definition at line 21 of file MCTargetAsmParser.cpp.
|
inlinevirtual |
Definition at line 226 of file MCTargetAsmParser.h.
|
inlinevirtual |
Validate the instruction match against any complex target predicates before rendering any operands to it.
Definition at line 208 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 214 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 24 of file MCTargetAsmParser.cpp.
References llvm::MCAsmParserExtension::getContext(), getSTI(), llvm::MCContext::getSubtargetCopy(), and STI.
|
inlinevirtual |
Definition at line 238 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 222 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 236 of file MCTargetAsmParser.h.
|
inline |
Definition at line 132 of file MCTargetAsmParser.h.
References AvailableFeatures.
| const MCSubtargetInfo & MCTargetAsmParser::getSTI | ( | ) | const |
|
inline |
Definition at line 138 of file MCTargetAsmParser.h.
References MCOptions.
Definition at line 224 of file MCTargetAsmParser.h.
|
inline |
Definition at line 135 of file MCTargetAsmParser.h.
References ParsingInlineAsm.
|
pure virtual |
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.
Allows targets to let registers opt out of clobber lists.
Definition at line 194 of file MCTargetAsmParser.h.
|
inlinevirtual |
Definition at line 232 of file MCTargetAsmParser.h.
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.
| DirectiveID | - the identifier token of the directive. |
|
pure virtual |
ParseInstruction - 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 165 of file MCTargetAsmParser.h.
References llvm::AsmToken::getLoc(), and ParseInstruction().
|
pure virtual |
|
inline |
Definition at line 133 of file MCTargetAsmParser.h.
References AvailableFeatures.
Referenced by llvm::AVRAsmParser::AVRAsmParser().
|
inlinevirtual |
Sets frame register corresponding to the current MachineFunction.
Definition at line 148 of file MCTargetAsmParser.h.
|
inline |
Definition at line 136 of file MCTargetAsmParser.h.
References ParsingInlineAsm.
|
inline |
Definition at line 140 of file MCTargetAsmParser.h.
References SemaCallback.
|
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 200 of file MCTargetAsmParser.h.
References Match_InvalidOperand.
|
protected |
AvailableFeatures - The current set of available features.
Definition at line 112 of file MCTargetAsmParser.h.
Referenced by getAvailableFeatures(), and setAvailableFeatures().
|
protected |
Set of options which affects instrumentation of inline assembly.
Definition at line 122 of file MCTargetAsmParser.h.
Referenced by getTargetOptions().
|
protected |
ParsingInlineAsm - Are we parsing ms-style inline assembly?
Definition at line 115 of file MCTargetAsmParser.h.
Referenced by isParsingInlineAsm(), and setParsingInlineAsm().
|
protected |
SemaCallback - The Sema callback implementation.
Must be set when parsing ms-style inline assembly.
Definition at line 119 of file MCTargetAsmParser.h.
Referenced by setSemaCallback().
|
protected |
Current STI.
Definition at line 125 of file MCTargetAsmParser.h.
1.8.6