9 #ifndef LLVM_MC_MCPARSER_MCASMPARSER_H 10 #define LLVM_MC_MCPARSER_MCASMPARSER_H 27 class MCAsmParserExtension;
33 class MCTargetAsmParser;
98 virtual void LookupInlineAsmIdentifier(
StringRef &LineBuf,
100 bool IsUnevaluatedContext) = 0;
102 SMLoc Location,
bool Create) = 0;
113 std::pair<MCAsmParserExtension*, DirectiveHandler>;
130 bool HadError =
false;
132 bool ShowParsedOperands =
false;
139 virtual void addDirectiveHandler(StringRef
Directive,
142 virtual void addAliasForDirective(StringRef
Directive, StringRef Alias) = 0;
144 virtual SourceMgr &getSourceManager() = 0;
166 virtual bool Run(
bool NoInitialTextSection,
bool NoFinalize =
false) = 0;
168 virtual void setParsingInlineAsm(
bool V) = 0;
169 virtual bool isParsingInlineAsm() = 0;
172 virtual bool parseMSInlineAsm(
173 void *AsmLoc, std::string &AsmString,
unsigned &NumOutputs,
174 unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
203 bool rv = !PendingErrors.
empty();
204 for (
auto Err : PendingErrors) {
205 printError(Err.Loc,
Twine(Err.Msg), Err.Range);
207 PendingErrors.clear();
213 bool addErrorSuffix(
const Twine &Suffix);
225 bool parseTokenLoc(
SMLoc &Loc);
231 bool parseEOL(
const Twine &ErrMsg);
233 bool parseMany(
function_ref<
bool()> parseOne,
bool hasComma =
true);
235 bool parseIntToken(int64_t &V,
const Twine &ErrMsg);
237 bool check(
bool P,
const Twine &Msg);
238 bool check(
bool P,
SMLoc Loc,
const Twine &Msg);
242 virtual bool parseIdentifier(StringRef &Res) = 0;
247 virtual StringRef parseStringToEndOfStatement() = 0;
251 virtual bool parseEscapedString(std::string &
Data) = 0;
254 virtual void eatToEndOfStatement() = 0;
261 virtual bool parseExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
262 bool parseExpression(
const MCExpr *&Res);
269 virtual bool parsePrimaryExpr(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
277 virtual bool parseParenExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
284 virtual bool parseAbsoluteExpression(int64_t &Res) = 0;
289 virtual bool checkForValidSection() = 0;
299 virtual bool parseParenExprOfDepth(
unsigned ParenDepth,
const MCExpr *&Res,
309 #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.
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.
Context object for machine code objects.
void setShowParsedOperands(bool Value)
Directive
IDs for all OpenMP directives.
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.