LLVM 22.0.0git
|
Target independent representation for an assembler token. More...
#include "llvm/MC/MCAsmMacro.h"
Public Types | |
enum | TokenKind { Eof , Error , Identifier , String , Integer , BigNum , Real , Comment , HashDirective , EndOfStatement , Colon , Space , Plus , Minus , Tilde , Slash , BackSlash , LParen , RParen , LBrac , RBrac , LCurly , RCurly , Question , Star , Dot , Comma , Dollar , Equal , EqualEqual , Pipe , PipePipe , Caret , Amp , AmpAmp , Exclaim , ExclaimEqual , Percent , Hash , Less , LessEqual , LessLess , LessGreater , Greater , GreaterEqual , GreaterGreater , At , MinusGreater } |
Public Member Functions | |
AsmToken ()=default | |
AsmToken (TokenKind Kind, StringRef Str, APInt IntVal) | |
AsmToken (TokenKind Kind, StringRef Str, int64_t IntVal=0) | |
TokenKind | getKind () const |
bool | is (TokenKind K) const |
bool | isNot (TokenKind K) const |
LLVM_ABI SMLoc | getLoc () const |
LLVM_ABI SMLoc | getEndLoc () const |
LLVM_ABI SMRange | getLocRange () const |
StringRef | getStringContents () const |
Get the contents of a string token (without quotes). | |
StringRef | getIdentifier () const |
Get the identifier string for the current token, which should be an identifier or a string. | |
StringRef | getString () const |
Get the string for the current token, this includes all characters (for example, the quotes on strings) in the token. | |
int64_t | getIntVal () const |
APInt | getAPIntVal () const |
LLVM_ABI void | dump (raw_ostream &OS) const |
Target independent representation for an assembler token.
Definition at line 22 of file MCAsmMacro.h.
Definition at line 24 of file MCAsmMacro.h.
|
default |
Definition at line 69 of file MCAsmMacro.h.
References llvm::move().
Definition at line 71 of file MCAsmMacro.h.
void AsmToken::dump | ( | raw_ostream & | OS | ) | const |
Definition at line 40 of file AsmLexer.cpp.
References Amp, AmpAmp, At, BackSlash, BigNum, Caret, Colon, Comma, Comment, Dollar, Dot, EndOfStatement, Eof, Equal, EqualEqual, Error, Exclaim, ExclaimEqual, getString(), Greater, GreaterEqual, GreaterGreater, Hash, HashDirective, Identifier, Integer, LBrac, LCurly, Less, LessEqual, LessGreater, LessLess, LParen, Minus, MinusGreater, Percent, Pipe, PipePipe, Plus, Question, RBrac, RCurly, Real, RParen, Slash, Space, Star, String, Tilde, and llvm::raw_ostream::write_escaped().
|
inline |
Definition at line 113 of file MCAsmMacro.h.
SMLoc AsmToken::getEndLoc | ( | ) | const |
Definition at line 34 of file AsmLexer.cpp.
References llvm::SMLoc::getFromPointer().
Referenced by getLocRange().
|
inline |
Get the identifier string for the current token, which should be an identifier or a string.
This gets the portion of the string which should be used as the identifier, e.g., it does not include the quotes on strings.
Definition at line 92 of file MCAsmMacro.h.
References getString(), getStringContents(), and Identifier.
Referenced by isSDKVersionToken().
|
inline |
Definition at line 108 of file MCAsmMacro.h.
References assert(), and Integer.
Referenced by llvm::MCAsmParser::parseGNUAttribute(), and llvm::MCAsmParser::parseIntToken().
|
inline |
Definition at line 74 of file MCAsmMacro.h.
Referenced by llvm::AsmLexer::getKind(), and llvm::MCAsmParser::parseOptionalToken().
SMLoc AsmToken::getLoc | ( | ) | const |
Definition at line 32 of file AsmLexer.cpp.
References llvm::SMLoc::getFromPointer().
Referenced by getLocRange(), llvm::MCParserUtils::parseAssignmentExpression(), llvm::MCTargetAsmParser::parseDirective(), llvm::MCAsmParser::parseGNUAttribute(), llvm::MCTargetAsmParser::parseInstruction(), and llvm::MCAsmParser::parseTokenLoc().
SMRange AsmToken::getLocRange | ( | ) | const |
Definition at line 38 of file AsmLexer.cpp.
References getEndLoc(), and getLoc().
|
inline |
Get the string for the current token, this includes all characters (for example, the quotes on strings) in the token.
The returned StringRef points into the source manager's memory buffer, and is safe to store across calls to Lex().
Definition at line 103 of file MCAsmMacro.h.
Referenced by dump(), and getIdentifier().
|
inline |
Get the contents of a string token (without quotes).
Definition at line 83 of file MCAsmMacro.h.
References assert(), and String.
Referenced by getIdentifier().
Definition at line 75 of file MCAsmMacro.h.
Referenced by llvm::AsmLexer::is(), isSDKVersionToken(), and llvm::AsmLexer::peekTokens().
Definition at line 76 of file MCAsmMacro.h.
Referenced by llvm::AsmLexer::isNot(), and llvm::MCAsmParser::parseGNUAttribute().