13 #include "llvm/Config/llvm-config.h" 29 assert(!TargetParser &&
"Target parser is already initialized!");
53 if (
getTok().getKind() != T)
80 return Error(Loc, Msg);
134 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 135 dbgs() <<
" " << *
this;
Represents a range in source code.
const AsmToken & getTok() const
Get the current (last) lexed token.
bool addErrorSuffix(const Twine &Suffix)
This class represents lattice values for constants.
virtual void dump() const
dump - Print to the debug stream.
virtual void Initialize(MCAsmParser &Parser)
Initialize the extension for parsing using the given Parser.
MCTargetAsmParser - Generic interface to target specific assembly parsers.
SmallVector< MCPendingError, 0 > PendingErrors
bool check(bool P, const Twine &Msg)
An efficient, type-erasing, non-owning reference to a callable.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
const AsmToken & getTok() const
Get the current AsmToken from the stream.
bool parseIntToken(int64_t &V, const Twine &ErrMsg)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Base class for the full range of assembler expressions which are needed for parsing.
Target independent representation for an assembler token.
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
bool parseToken(AsmToken::TokenKind T, const Twine &Msg="unexpected token")
virtual MCAsmLexer & getLexer()=0
bool parseTokenLoc(SMLoc &Loc)
int64_t getIntVal() const
bool Error(SMLoc L, const Twine &Msg, SMRange Range=None)
Return an error at the location L, with the message Msg.
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
bool parseMany(function_ref< bool()> parseOne, bool hasComma=true)
const AsmToken & Lex()
Consume the next token from the input stream and return it.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool TokError(const Twine &Msg, SMRange Range=None)
Report an error at the current lexer location.
bool parseEOL(const Twine &ErrMsg)
void setTargetParser(MCTargetAsmParser &P)
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
Represents a location in source code.
TokenKind getKind() const