10 #ifndef LLVM_MC_MCPARSER_MCASMPARSER_H
11 #define LLVM_MC_MCPARSER_MCASMPARSER_H
16 #include "llvm/Support/DataTypes.h"
21 class MCAsmParserExtension;
27 class MCTargetAsmParser;
54 bool IsUnevaluatedContext) = 0;
56 SMLoc Location,
bool Create) = 0;
59 unsigned &Offset) = 0;
67 typedef std::pair<MCAsmParserExtension*, DirectiveHandler>
76 unsigned ShowParsedOperands : 1;
111 virtual bool Run(
bool NoInitialTextSection,
bool NoFinalize =
false) = 0;
118 void *AsmLoc, std::string &AsmString,
unsigned &NumOutputs,
119 unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
virtual bool Warning(SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
Emit a warning at the location L, with the message Msg.
virtual ~MCAsmParserSemaCallback()
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void setAssemblerDialect(unsigned i)
MCTargetAsmParser - Generic interface to target specific assembly parsers.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual SourceMgr & getSourceManager()=0
virtual void * LookupInlineAsmIdentifier(StringRef &LineBuf, InlineAsmIdentifierInfo &Info, bool IsUnevaluatedContext)=0
virtual void Note(SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
Emit a note at the location L, with the message Msg.
bool TokError(const Twine &Msg, ArrayRef< SMRange > Ranges=None)
Report an error at the current lexer location.
MCTargetAsmParser & getTargetParser() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Generic assembler lexer interface, for use by target specific assembly lexers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for the full range of assembler expressions which are needed for parsing.
Target independent representation for an assembler token.
virtual void addDirectiveHandler(StringRef Directive, ExtensionDirectiveHandler Handler)=0
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
Context object for machine code objects.
void setShowParsedOperands(bool Value)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual bool parseEscapedString(std::string &Data)=0
Parse the current token as a string which may include escaped characters and return the string conten...
const AsmToken & getTok() const
Get the current AsmToken from the stream.
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
virtual void addAliasForDirective(StringRef Directive, StringRef Alias)=0
virtual MCContext & getContext()=0
Streaming machine code generation interface.
The instances of the Type class are immutable: once they are created, they are never changed...
virtual bool isParsingInlineAsm()=0
virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse a primary expression.
const MCAsmLexer & getLexer() const
Interface to description of machine instruction set.
virtual bool Run(bool NoInitialTextSection, bool NoFinalize=false)=0
Run the parser on the input source buffer.
virtual MCAsmLexer & getLexer()=0
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &)
Create an MCAsmParser instance.
Generic Sema callback for assembly parser.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
virtual StringRef parseStringToEndOfStatement()=0
Parse up to the end of statement and return the contents from the current token until the end of the ...
virtual bool Error(SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
Emit an error at the location L, with the message Msg.
virtual bool LookupInlineAsmField(StringRef Base, StringRef Member, unsigned &Offset)=0
virtual void setParsingInlineAsm(bool V)=0
virtual MCStreamer & getStreamer()=0
Return the output streamer for the assembler.
virtual bool parseParenExprOfDepth(unsigned ParenDepth, const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression of a specified parenthesis depth, assuming that the initial '(' charact...
virtual void checkForValidSection()=0
Ensure that we have a valid section set in the streamer.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
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.
virtual StringRef LookupInlineAsmLabel(StringRef Identifier, SourceMgr &SM, SMLoc Location, bool Create)=0
bool(* DirectiveHandler)(MCAsmParserExtension *, StringRef, SMLoc)
virtual bool parseAbsoluteExpression(int64_t &Res)=0
Parse an expression which must evaluate to an absolute value.
virtual unsigned getAssemblerDialect()
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
LLVM Value Representation.
void setTargetParser(MCTargetAsmParser &P)
StringRef - Represent a constant reference to a string, i.e.
virtual bool parseIdentifier(StringRef &Res)=0
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents...
bool getShowParsedOperands() const
Represents a location in source code.
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression, assuming that an initial '(' has already been consumed.