9#ifndef LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
10#define LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
31 template<
typename T,
bool (T::*Handler)(StringRef, SMLoc)>
36 return (Obj->*Handler)(
Directive, DirectiveLoc);
88 const Twine &Msg =
"unexpected token") {
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
Target independent representation for an assembler token.
Generic assembler lexer interface, for use by target specific assembly lexers.
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
SourceMgr & getSourceManager()
const MCAsmParser & getParser() const
bool parseOptionalToken(AsmToken::TokenKind T)
static bool HandleDirective(MCAsmParserExtension *Target, StringRef Directive, SMLoc DirectiveLoc)
virtual ~MCAsmParserExtension()
bool addErrorSuffix(const Twine &Suffix)
const AsmToken & getTok()
MCAsmParserExtension & operator=(const MCAsmParserExtension &)=delete
bool parseMany(function_ref< bool()> parseOne, bool hasComma=true)
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
MCAsmParserExtension(const MCAsmParserExtension &)=delete
bool Warning(SMLoc L, const Twine &Msg)
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
bool HasBracketExpressions() const
bool TokError(const Twine &Msg)
bool check(bool P, const Twine &Msg)
void Note(SMLoc L, const Twine &Msg)
bool Error(SMLoc L, const Twine &Msg, SMRange Range=SMRange())
bool check(bool P, SMLoc Loc, const Twine &Msg)
bool ParseDirectiveCGProfile(StringRef, SMLoc)
ParseDirectiveCGProfile ::= .cg_profile identifier, identifier, <number>
bool BracketExpressionsSupported
MCStreamer & getStreamer()
const MCAsmLexer & getLexer() const
MCAsmParser & getParser()
Generic assembler parser interface, for use by target specific assembly parsers.
bool parseMany(function_ref< bool()> parseOne, bool hasComma=true)
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
bool addErrorSuffix(const Twine &Suffix)
bool check(bool P, const Twine &Msg)
virtual MCStreamer & getStreamer()=0
Return the output streamer for the assembler.
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 SourceMgr & getSourceManager()=0
const AsmToken & getTok() const
Get the current AsmToken from the stream.
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual MCAsmLexer & getLexer()=0
virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)=0
Emit a warning at the location L, with the message Msg.
bool TokError(const Twine &Msg, SMRange Range=std::nullopt)
Report an error at the current lexer location.
virtual MCContext & getContext()=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.
Streaming machine code generation interface.
Represents a location in source code.
Represents a range in source code.
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.
Target - Wrapper for Target specific information.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.