12#include "llvm/Config/llvm-config.h"
28 cl::desc(
"The maximum nesting depth allowed for assembly macros."));
38 assert(!TargetParser &&
"Target parser is already initialized!");
40 TargetParser->Initialize(*
this);
54 return Error(
getTok().getLoc(),
"expected newline");
148 int64_t &IntegerValue) {
177#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
const AsmToken & getTok() const
Get the current (last) lexed token.
const AsmToken & Lex()
Consume the next token from the input stream and return it.
Target independent representation for an assembler token.
LLVM_ABI SMLoc getLoc() const
int64_t getIntVal() const
bool isNot(TokenKind K) const
TokenKind getKind() const
This class is intended to be used as a base class for asm properties and features specific to the tar...
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)
bool parseIntToken(int64_t &V, const Twine &ErrMsg="expected integer")
virtual bool parseExpression(const MCExpr *&Res, SMLoc &EndLoc)=0
Parse an arbitrary expression.
const AsmToken & getTok() const
Get the current AsmToken from the stream.
virtual bool parseIdentifier(StringRef &Res)=0
Parse an identifier or string (as a quoted identifier) and set Res to the identifier contents.
bool parseSymbol(MCSymbol *&Res)
Parse identifier and get or create symbol for it.
SmallVector< MCPendingError, 0 > PendingErrors
MCAsmParser(MCContext &, MCStreamer &, SourceMgr &, const MCAsmInfo &)
bool parseOptionalToken(AsmToken::TokenKind T)
Attempt to parse and consume token, returning true on success.
virtual const AsmToken & Lex()=0
Get the next AsmToken in the stream, possibly handling file inclusion first.
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.
Context object for machine code objects.
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
virtual void dump() const
dump - Print to the debug stream.
virtual void print(raw_ostream &, const MCAsmInfo &) const =0
print - Print a debug representation of the operand to the given stream.
Streaming machine code generation interface.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCTargetAsmParser - Generic interface to target specific assembly parsers.
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_ABI 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
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.