9#ifndef LLVM_MC_MCPARSER_MCASMPARSER_H
10#define LLVM_MC_MCPARSER_MCASMPARSER_H
71 Enum.EnumVal = enumVal;
78 void setVar(
void *decl,
bool isGlobalLV,
unsigned size,
unsigned type) {
82 Var.IsGlobalLV = isGlobalLV;
115 bool IsUnevaluatedContext) = 0;
117 SMLoc Location,
bool Create) = 0;
128 std::pair<MCAsmParserExtension*, DirectiveHandler>;
180 virtual bool Run(
bool NoInitialTextSection,
bool NoFinalize =
false) = 0;
205 std::string &AsmString,
unsigned &NumOutputs,
unsigned &NumInputs,
248 bool addErrorSuffix(
const Twine &Suffix);
269 bool parseEOL(
const Twine &ErrMsg);
271 bool parseMany(
function_ref<
bool()> parseOne,
bool hasComma =
true);
273 bool parseIntToken(int64_t &V,
const Twine &ErrMsg =
"expected integer");
275 bool check(
bool P,
const Twine &Msg);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Analysis containing CSE Info
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
This file defines the SmallString class.
This file defines the SmallVector class.
Target independent representation for an assembler token.
This class is intended to be used as a base class for asm properties and features specific to the tar...
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
Generic Sema callback for assembly parser.
virtual ~MCAsmParserSemaCallback()
virtual bool LookupInlineAsmField(StringRef Base, StringRef Member, unsigned &Offset)=0
virtual StringRef LookupInlineAsmLabel(StringRef Identifier, SourceMgr &SM, SMLoc Location, bool Create)=0
virtual void LookupInlineAsmIdentifier(StringRef &LineBuf, InlineAsmIdentifierInfo &Info, bool IsUnevaluatedContext)=0
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void eatToEndOfStatement()=0
Skip to the end of the current statement, for error recovery.
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
virtual bool printError(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)=0
Emit an error at the location L, with the message Msg.
bool printPendingErrors()
virtual bool parseEscapedString(std::string &Data)=0
Parse the current token as a string which may include escaped characters and return the string conten...
virtual bool defineMacro(StringRef Name, StringRef Value)
void clearPendingErrors()
virtual void Note(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)=0
Emit a note at the location L, with the message Msg.
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 parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
bool parseAtSpecifier(const MCExpr *&Res, SMLoc &EndLoc)
const AsmToken & getTok() const
Get the current AsmToken from the stream.
const MCExpr * applySpecifier(const MCExpr *E, uint32_t Variant)
virtual bool checkForValidSection()=0
Ensure that we have a valid section set in the streamer.
virtual bool isParsingMasm() const
virtual bool parseIdentifier(StringRef &Res)=0
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents.
MCAsmParser(const MCAsmParser &)=delete
bool getShowParsedOperands() const
virtual bool discardLTOSymbol(StringRef) const
MCAsmParser & operator=(const MCAsmParser &)=delete
SmallVector< MCPendingError, 0 > PendingErrors
virtual bool parseParenExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression, assuming that an initial '(' has already been consumed.
MCAsmParser(MCContext &, MCStreamer &, SourceMgr &, const MCAsmInfo &)
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
virtual bool isParsingMSInlineAsm()=0
virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc, AsmTypeInfo *TypeInfo=nullptr)=0
Parse a primary expression.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual unsigned getAssemblerDialect()
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
void setShowParsedOperands(bool Value)
bool(*)(MCAsmParserExtension *, StringRef, SMLoc) DirectiveHandler
virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)=0
Emit a warning at the location L, with the message Msg.
virtual bool Run(bool NoInitialTextSection, bool NoFinalize=false)=0
Run the parser on the input source buffer.
virtual void addAliasForDirective(StringRef Directive, StringRef Alias)=0
virtual bool parseAngleBracketString(std::string &Data)=0
Parse an angle-bracket delimited string at the current position if one is present,...
virtual bool lookUpType(StringRef Name, AsmTypeInfo &Info) const
bool TokError(const Twine &Msg, SMRange Range=std::nullopt)
Report an error at the current lexer location.
SourceMgr & getSourceManager()
virtual bool lookUpField(StringRef Base, StringRef Member, AsmFieldInfo &Info) const
virtual bool parseAbsoluteExpression(int64_t &Res)=0
Parse an expression which must evaluate to an absolute value.
virtual bool lookUpField(StringRef Name, AsmFieldInfo &Info) const
const AsmLexer & getLexer() const
bool parseTokenLoc(SMLoc &Loc)
bool parseGNUAttribute(SMLoc L, int64_t &Tag, int64_t &IntegerValue)
Parse a .gnu_attribute.
MCStreamer & getStreamer()
virtual void setAssemblerDialect(unsigned i)
virtual void setParsingMSInlineAsm(bool V)=0
bool HadError
Flag tracking whether any errors have been encountered.
virtual bool parseMSInlineAsm(std::string &AsmString, unsigned &NumOutputs, unsigned &NumInputs, SmallVectorImpl< std::pair< void *, bool > > &OpDecls, SmallVectorImpl< std::string > &Constraints, SmallVectorImpl< std::string > &Clobbers, const MCInstrInfo *MII, MCInstPrinter *IP, MCAsmParserSemaCallback &SI)=0
Parse MS-style inline assembly.
MCTargetAsmParser & getTargetParser() const
virtual void addDirectiveHandler(StringRef Directive, ExtensionDirectiveHandler Handler)=0
bool Error(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)
Return an error at the location L, with the message Msg.
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Interface to description of machine instruction set.
Streaming machine code generation interface.
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Represents a location in source code.
Represents a range in source code.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
LLVM_ABI MCAsmParser * createMCMasmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, struct tm, unsigned CB=0)
Create an MCAsmParser instance for parsing Microsoft MASM-style assembly.
LLVM_ABI MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance for parsing assembly similar to gas syntax.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
void setVar(void *decl, bool isGlobalLV, unsigned size, unsigned type)
void setLabel(void *decl)
bool isKind(IdKind kind) const
void setEnum(int64_t enumVal)
InlineAsmIdentifierInfo()=default