|
LLVM
3.7.0
|
Generic assembler parser interface, for use by target specific assembly parsers. More...
#include <MCAsmParser.h>
Public Types | |
| typedef bool(* | DirectiveHandler )(MCAsmParserExtension *, StringRef, SMLoc) |
| typedef std::pair < MCAsmParserExtension *, DirectiveHandler > | ExtensionDirectiveHandler |
Public Member Functions | |
| virtual | ~MCAsmParser () |
| virtual void | addDirectiveHandler (StringRef Directive, ExtensionDirectiveHandler Handler)=0 |
| virtual void | addAliasForDirective (StringRef Directive, StringRef Alias)=0 |
| virtual SourceMgr & | getSourceManager ()=0 |
| virtual MCAsmLexer & | getLexer ()=0 |
| const MCAsmLexer & | getLexer () const |
| virtual MCContext & | getContext ()=0 |
| virtual MCStreamer & | getStreamer ()=0 |
| Return the output streamer for the assembler. More... | |
| MCTargetAsmParser & | getTargetParser () const |
| void | setTargetParser (MCTargetAsmParser &P) |
| virtual unsigned | getAssemblerDialect () |
| virtual void | setAssemblerDialect (unsigned i) |
| bool | getShowParsedOperands () const |
| void | setShowParsedOperands (bool Value) |
| virtual bool | Run (bool NoInitialTextSection, bool NoFinalize=false)=0 |
| Run the parser on the input source buffer. More... | |
| virtual void | setParsingInlineAsm (bool V)=0 |
| virtual bool | isParsingInlineAsm ()=0 |
| virtual bool | parseMSInlineAsm (void *AsmLoc, std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, SmallVectorImpl< std::pair< void *, bool >> &OpDecls, SmallVectorImpl< std::string > &Constraints, SmallVectorImpl< std::string > &Clobbers, const MCInstrInfo *MII, const MCInstPrinter *IP, MCAsmParserSemaCallback &SI)=0 |
| Parse MS-style inline assembly. More... | |
| virtual void | Note (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0 |
Emit a note at the location L, with the message Msg. More... | |
| virtual bool | Warning (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0 |
Emit a warning at the location L, with the message Msg. More... | |
| virtual bool | Error (SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0 |
Emit an error at the location L, with the message Msg. More... | |
| virtual const AsmToken & | Lex ()=0 |
| Get the next AsmToken in the stream, possibly handling file inclusion first. More... | |
| const AsmToken & | getTok () const |
| Get the current AsmToken from the stream. More... | |
| bool | TokError (const Twine &Msg, ArrayRef< SMRange > Ranges=None) |
| Report an error at the current lexer location. More... | |
| virtual bool | parseIdentifier (StringRef &Res)=0 |
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents. More... | |
| virtual StringRef | parseStringToEndOfStatement ()=0 |
| Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF. More... | |
| virtual bool | parseEscapedString (std::string &Data)=0 |
| Parse the current token as a string which may include escaped characters and return the string contents. More... | |
| virtual void | eatToEndOfStatement ()=0 |
| Skip to the end of the current statement, for error recovery. More... | |
| virtual bool | parseExpression (const MCExpr *&Res, SMLoc &EndLoc)=0 |
| Parse an arbitrary expression. More... | |
| bool | parseExpression (const MCExpr *&Res) |
| virtual bool | parsePrimaryExpr (const MCExpr *&Res, SMLoc &EndLoc)=0 |
| Parse a primary expression. More... | |
| virtual bool | parseParenExpression (const MCExpr *&Res, SMLoc &EndLoc)=0 |
| Parse an arbitrary expression, assuming that an initial '(' has already been consumed. More... | |
| virtual bool | parseAbsoluteExpression (int64_t &Res)=0 |
| Parse an expression which must evaluate to an absolute value. More... | |
| virtual void | checkForValidSection ()=0 |
| Ensure that we have a valid section set in the streamer. More... | |
| virtual bool | parseParenExprOfDepth (unsigned ParenDepth, const MCExpr *&Res, SMLoc &EndLoc)=0 |
| Parse an arbitrary expression of a specified parenthesis depth, assuming that the initial '(' characters have already been consumed. More... | |
Protected Member Functions | |
| MCAsmParser () | |
Generic assembler parser interface, for use by target specific assembly parsers.
Definition at line 64 of file MCAsmParser.h.
| typedef bool(* llvm::MCAsmParser::DirectiveHandler)(MCAsmParserExtension *, StringRef, SMLoc) |
Definition at line 66 of file MCAsmParser.h.
| typedef std::pair<MCAsmParserExtension*, DirectiveHandler> llvm::MCAsmParser::ExtensionDirectiveHandler |
Definition at line 68 of file MCAsmParser.h.
|
protected |
Definition at line 20 of file MCAsmParser.cpp.
|
virtual |
Definition at line 23 of file MCAsmParser.cpp.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Ensure that we have a valid section set in the streamer.
Otherwise, report an error and switch to .text.
|
pure virtual |
Skip to the end of the current statement, for error recovery.
Referenced by llvm::MCParserUtils::parseAssignmentExpression().
|
pure virtual |
Emit an error at the location L, with the message Msg.
Referenced by llvm::MCAsmParserExtension::Error(), llvm::MCParserUtils::parseAssignmentExpression(), and TokError().
|
inlinevirtual |
Definition at line 104 of file MCAsmParser.h.
|
pure virtual |
|
pure virtual |
|
inline |
Definition at line 92 of file MCAsmParser.h.
References getLexer().
|
inline |
Definition at line 107 of file MCAsmParser.h.
|
pure virtual |
Referenced by llvm::MCAsmParserExtension::getSourceManager().
|
pure virtual |
Return the output streamer for the assembler.
Referenced by llvm::MCAsmParserExtension::getStreamer(), and llvm::MCParserUtils::parseAssignmentExpression().
|
inline |
Definition at line 101 of file MCAsmParser.h.
Get the current AsmToken from the stream.
Definition at line 32 of file MCAsmParser.cpp.
References getLexer(), and llvm::MCAsmLexer::getTok().
Referenced by llvm::MCAsmParserExtension::getTok().
|
pure virtual |
Get the next AsmToken in the stream, possibly handling file inclusion first.
Referenced by llvm::MCAsmParserExtension::Lex(), and llvm::MCParserUtils::parseAssignmentExpression().
|
pure virtual |
Emit a note at the location L, with the message Msg.
|
pure virtual |
Parse an expression which must evaluate to an absolute value.
| Res | - The value of the absolute expression. The result is undefined on error. |
|
pure virtual |
Parse the current token as a string which may include escaped characters and return the string contents.
|
pure virtual |
Parse an arbitrary expression.
| Res | - The value of the expression. The result is undefined on error. |
Referenced by llvm::MCParserUtils::parseAssignmentExpression(), and parseExpression().
Definition at line 41 of file MCAsmParser.cpp.
References parseExpression().
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents.
|
pure virtual |
Parse MS-style inline assembly.
|
pure virtual |
Parse an arbitrary expression, assuming that an initial '(' has already been consumed.
| Res | - The value of the expression. The result is undefined on error. |
|
pure virtual |
Parse an arbitrary expression of a specified parenthesis depth, assuming that the initial '(' characters have already been consumed.
| ParenDepth | - Specifies how many trailing expressions outside the current parentheses we have to parse. |
| Res | - The value of the expression. The result is undefined on error. |
|
pure virtual |
Parse a primary expression.
| Res | - The value of the expression. The result is undefined on error. |
|
pure virtual |
Parse up to the end of statement and return the contents from the current token until the end of the statement; the current token on exit will be either the EndOfStatement or EOF.
|
pure virtual |
Run the parser on the input source buffer.
|
inlinevirtual |
Definition at line 105 of file MCAsmParser.h.
|
pure virtual |
|
inline |
Definition at line 108 of file MCAsmParser.h.
| void MCAsmParser::setTargetParser | ( | MCTargetAsmParser & | P | ) |
Definition at line 26 of file MCAsmParser.cpp.
References llvm::MCAsmParserExtension::Initialize(), and P.
Report an error at the current lexer location.
Definition at line 36 of file MCAsmParser.cpp.
References Error(), and getLexer().
Referenced by llvm::MCParserUtils::parseAssignmentExpression(), and llvm::MCAsmParserExtension::TokError().
|
pure virtual |
Emit a warning at the location L, with the message Msg.
Referenced by llvm::MCAsmParserExtension::Warning().
1.8.6