12#include "llvm/Config/llvm-config.h"
27 cl::desc(
"The maximum nesting depth allowed for assembly macros."));
35 assert(!TargetParser &&
"Target parser is already initialized!");
51 return Error(
getTok().getLoc(),
"expected newline");
93 return Error(Loc, Msg);
145 int64_t &IntegerValue) {
165#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
166 dbgs() <<
" " << *
this;
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Target independent representation for an assembler token.
int64_t getIntVal() const
bool isNot(TokenKind K) const
TokenKind getKind() const
Lightweight error class with error context and mandatory checking.
const AsmToken & getTok() const
Get the current (last) lexed token.
const AsmToken & Lex()
Consume the next token from the input stream and return it.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
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 bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
const AsmToken & getTok() const
Get the current AsmToken from the stream.
SmallVector< MCPendingError, 0 > PendingErrors
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
bool parseIntToken(int64_t &V, const Twine &ErrMsg)
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
virtual MCAsmLexer & getLexer()=0
bool TokError(const Twine &Msg, SMRange Range=std::nullopt)
Report an error at the current lexer location.
bool parseTokenLoc(SMLoc &Loc)
bool parseGNUAttribute(SMLoc L, int64_t &Tag, int64_t &IntegerValue)
Parse a .gnu_attribute.
void setTargetParser(MCTargetAsmParser &P)
bool Error(SMLoc L, const Twine &Msg, SMRange Range=std::nullopt)
Return an error at the location L, with the message Msg.
Base class for the full range of assembler expressions which are needed for parsing.
virtual void dump() const
dump - Print to the debug stream.
MCTargetAsmParser - Generic interface to target specific assembly parsers.
Represents a location in source code.
Represents a range in source code.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
An efficient, type-erasing, non-owning reference to a callable.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< unsigned > AsmMacroMaxNestingDepth
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.