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>;
125 unsigned ShowParsedOperands : 1;
131 bool HadError =
false;
133 bool EnablePrintSchedInfo =
false;
142 virtual void addDirectiveHandler(StringRef Directive,
145 virtual void addAliasForDirective(StringRef Directive, StringRef Alias) = 0;
147 virtual SourceMgr &getSourceManager() = 0;
172 virtual bool Run(
bool NoInitialTextSection,
bool NoFinalize =
false) = 0;
174 virtual void setParsingInlineAsm(
bool V) = 0;
175 virtual bool isParsingInlineAsm() = 0;
178 virtual bool parseMSInlineAsm(
179 void *AsmLoc, std::string &AsmString,
unsigned &NumOutputs,
180 unsigned &NumInputs,
SmallVectorImpl<std::pair<void *, bool>> &OpDecls,
209 bool rv = !PendingErrors.
empty();
210 for (
auto Err : PendingErrors) {
211 printError(Err.Loc,
Twine(Err.Msg), Err.Range);
213 PendingErrors.clear();
219 bool addErrorSuffix(
const Twine &Suffix);
231 bool parseTokenLoc(
SMLoc &Loc);
237 bool parseEOL(
const Twine &ErrMsg);
239 bool parseMany(
function_ref<
bool()> parseOne,
bool hasComma =
true);
241 bool parseIntToken(int64_t &V,
const Twine &ErrMsg);
243 bool check(
bool P,
const Twine &Msg);
244 bool check(
bool P,
SMLoc Loc,
const Twine &Msg);
248 virtual bool parseIdentifier(StringRef &Res) = 0;
253 virtual StringRef parseStringToEndOfStatement() = 0;
257 virtual bool parseEscapedString(std::string &
Data) = 0;
260 virtual void eatToEndOfStatement() = 0;
267 virtual bool parseExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
268 bool parseExpression(
const MCExpr *&Res);
275 virtual bool parsePrimaryExpr(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
283 virtual bool parseParenExpression(
const MCExpr *&Res,
SMLoc &EndLoc) = 0;
290 virtual bool parseAbsoluteExpression(int64_t &Res) = 0;
295 virtual bool checkForValidSection() = 0;
305 virtual bool parseParenExprOfDepth(
unsigned ParenDepth,
const MCExpr *&Res,
315 #endif // LLVM_MC_MCPARSER_MCASMPARSER_H Represents a range in source code.
Compute iterated dominance frontiers using a linear time algorithm.
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.
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.
void setEnablePrintSchedInfo(bool Value)
Context object for machine code objects.
void setShowParsedOperands(bool Value)
bool(*)(MCAsmParserExtension *, StringRef, SMLoc) DirectiveHandler
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...
SmallVector< MCPendingError, 1 > PendingErrors
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
bool shouldPrintSchedInfo()
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.