10 #ifndef LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
11 #define LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
33 template<
typename T,
bool (T::*Handler)(StringRef, SMLoc)>
37 T *Obj =
static_cast<T*
>(Target);
38 return (Obj->*Handler)(Directive, DirectiveLoc);
virtual bool Warning(SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
Emit a warning at the location L, with the message Msg.
SourceMgr & getSourceManager()
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.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual SourceMgr & getSourceManager()=0
bool TokError(const Twine &Msg, ArrayRef< SMRange > Ranges=None)
Report an error at the current lexer location.
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()
const AsmToken & getTok() const
Get the current AsmToken from the stream.
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)
MCAsmParser & getParser()
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
virtual bool Error(SMLoc L, const Twine &Msg, ArrayRef< SMRange > Ranges=None)=0
Emit an error at the location L, with the message Msg.
bool Error(SMLoc L, const Twine &Msg)
bool BracketExpressionsSupported
virtual MCStreamer & getStreamer()=0
Return the output streamer for the assembler.
bool HasBracketExpressions() const
Target - Wrapper for Target specific information.
virtual ~MCAsmParserExtension()
const MCAsmLexer & getLexer() const
Generic interface for extending the MCAsmParser, which is implemented by target and object file assem...
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.