9#ifndef LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
10#define LLVM_MC_MCPARSER_MCASMPARSEREXTENSION_H
32 template<
typename T,
bool (T::*Handler)(StringRef, SMLoc)>
37 return (Obj->*Handler)(
Directive, DirectiveLoc);
40 bool BracketExpressionsSupported =
false;
71 return getParser().Warning(L, Msg);
75 return getParser().Error(L, Msg,
Range);
79 getParser().Note(L, Msg);
83 return getParser().TokError(Msg);
89 const Twine &Msg =
"unexpected token") {
90 return getParser().parseToken(
T, Msg);
92 bool parseEOL() {
return getParser().parseEOL(); }
95 return getParser().parseMany(parseOne, hasComma);
99 return getParser().parseOptionalToken(
T);
104 bool maybeParseUniqueID(int64_t &UniqueID);
107 return getParser().check(
P, Msg);
111 return getParser().check(
P, Loc, Msg);
115 return getParser().addErrorSuffix(Suffix);
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
Target independent representation for an assembler token.
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)
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)
MCStreamer & getStreamer()
MCAsmParser & getParser()
const AsmLexer & getLexer() const
Generic assembler parser interface, for use by target specific assembly parsers.
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.