10 #ifndef LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
11 #define LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
33 template<
typename T,
bool (T::*Handler)(StringRef, SMLoc)>
38 return (Obj->*Handler)(Directive, DirectiveLoc);
84 const Twine &Msg =
"unexpected token") {
Represents a range in source code.
SourceMgr & getSourceManager()
bool addErrorSuffix(const Twine &Suffix)
virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range=None)=0
Emit a warning at the location L, with the message Msg.
Generic assembler parser interface, for use by target specific assembly parsers.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
bool parseOptionalToken(AsmToken::TokenKind T)
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual SourceMgr & getSourceManager()=0
bool Error(SMLoc L, const Twine &Msg, SMRange Range=SMRange())
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Generic assembler lexer interface, for use by target specific assembly lexers.
Target independent representation for an assembler token.
Context object for machine code objects.
const AsmToken & getTok()
bool parseMany(std::function< bool()> parseOne, bool hasComma=true)
const AsmToken & getTok() const
Get the current AsmToken from the stream.
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
virtual MCContext & getContext()=0
Streaming machine code generation interface.
bool Warning(SMLoc L, const Twine &Msg)
bool TokError(const Twine &Msg)
const MCAsmParser & getParser() const
virtual MCAsmLexer & getLexer()=0
MCStreamer & getStreamer()
static bool HandleDirective(MCAsmParserExtension *Target, StringRef Directive, SMLoc DirectiveLoc)
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
bool Error(SMLoc L, const Twine &Msg, SMRange Range=None)
Return an error at the location L, with the message Msg.
MCAsmParser & getParser()
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
bool parseMany(std::function< bool()> parseOne, bool hasComma=true)
bool BracketExpressionsSupported
virtual MCStreamer & getStreamer()=0
Return the output streamer for the assembler.
bool HasBracketExpressions() const
static const char * Target
bool addErrorSuffix(const Twine &Suffix)
bool check(bool P, const llvm::Twine &Msg)
Target - Wrapper for Target specific information.
bool check(bool P, SMLoc Loc, const llvm::Twine &Msg)
void Note(SMLoc L, const Twine &Msg)
virtual void Note(SMLoc L, const Twine &Msg, SMRange Range=None)=0
Emit a note at the location L, with the message Msg.
virtual ~MCAsmParserExtension()
const MCAsmLexer & getLexer() const
bool TokError(const Twine &Msg, SMRange Range=None)
Report an error at the current lexer location.
bool check(bool P, const llvm::Twine &Msg)
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
print Print MemDeps of function
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.