10 #ifndef LLVM_MC_MCPARSER_MCASMPARSER_H 11 #define LLVM_MC_MCPARSER_MCASMPARSER_H 28 class MCAsmParserExtension;
34 class MCTargetAsmParser;
99 virtual void LookupInlineAsmIdentifier(
StringRef &LineBuf,
101 bool IsUnevaluatedContext) = 0;
103 SMLoc Location,
bool Create) = 0;
114 std::pair<MCAsmParserExtension*, DirectiveHandler>;
131 bool HadError =
false;
134 bool EnablePrintSchedInfo =
false;
136 bool ShowParsedOperands =
false;
143 virtual void addDirectiveHandler(StringRef Directive,
146 virtual void addAliasForDirective(StringRef Directive, StringRef Alias) = 0;
148 virtual SourceMgr &getSourceManager() = 0;
173 virtual bool Run(
bool NoInitialTextSection,
bool NoFinalize =
false) = 0;
175 virtual void setParsingInlineAsm(
bool V) = 0;
176 virtual bool isParsingInlineAsm() = 0;
179 virtual bool parseMSInlineAsm(
180 void *AsmLoc, std::string &AsmString,
unsigned &NumOutputs,
181 unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
210 bool rv = !PendingErrors.
empty();
211 for (
auto Err : PendingErrors) {
212 printError(Err.Loc,
Twine(Err.Msg), Err.Range);
214 PendingErrors.clear();
220 bool addErrorSuffix(
const Twine &Suffix);
232 bool parseTokenLoc(
SMLoc &Loc);
238 bool parseEOL(
const Twine &ErrMsg);
240 bool parseMany(
function_ref<
bool()> parseOne,
bool hasComma =
true);
242 bool parseIntToken(int64_t &V,
const Twine &ErrMsg);
244 bool check(
bool P,
const Twine &Msg);
245 bool check(
bool P,
SMLoc Loc,
const Twine &Msg);
249 virtual bool parseIdentifier(StringRef &Res) = 0;
254 virtual StringRef parseStringToEndOfStatement() = 0;
258 virtual bool parseEscapedString(std::string &
Data) = 0;
261 virtual void eatToEndOfStatement() = 0;
268 virtual bool parseExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
269 bool parseExpression(
const MCExpr *&Res);
276 virtual bool parsePrimaryExpr(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
284 virtual bool parseParenExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
291 virtual bool parseAbsoluteExpression(int64_t &Res) = 0;
296 virtual bool checkForValidSection() = 0;
306 virtual bool parseParenExprOfDepth(
unsigned ParenDepth,
const MCExpr *&Res,
316 #endif // LLVM_MC_MCPARSER_MCASMPARSER_H Represents a range in source code.
This class represents lattice values for constants.
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void setAssemblerDialect(unsigned i)
bool isKind(IdKind kind) const
MCTargetAsmParser - Generic interface to target specific assembly parsers.
SmallVector< MCPendingError, 0 > PendingErrors
InlineAsmIdentifierInfo()
An efficient, type-erasing, non-owning reference to a callable.
void setEnum(int64_t enumVal)
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Generic assembler lexer interface, for use by target specific assembly lexers.
bool shouldPrintSchedInfo() const
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.
bool printPendingErrors()
Target independent representation for an assembler token.
void setEnablePrintSchedInfo(bool Value)
Context object for machine code objects.
void setShowParsedOperands(bool Value)
bool(*)(MCAsmParserExtension *, StringRef, SMLoc) DirectiveHandler
Analysis containing CSE Info
void clearPendingErrors()
const MCAsmLexer & getLexer() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
Streaming machine code generation interface.
Interface to description of machine instruction set.
Generic Sema callback for assembly parser.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
void setVar(void *decl, bool isGlobalLV, unsigned size, unsigned type)
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
LLVM_NODISCARD bool empty() const
bool getShowParsedOperands() const
virtual unsigned getAssemblerDialect()
void setLabel(void *decl)
MCTargetAsmParser & getTargetParser() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
LLVM Value Representation.
std::pair< MCAsmParserExtension *, DirectiveHandler > ExtensionDirectiveHandler
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.