|
LLVM
10.0.0
|
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, Star, Dot, Comma, Dollar, Equal, EqualEqual, Pipe, PipePipe, Caret, Amp, AmpAmp, Exclaim, ExclaimEqual, Percent, Hash, Less, LessEqual, LessLess, LessGreater, Greater, GreaterEqual, GreaterGreater, At, MinusGreater, PercentCall16, PercentCall_Hi, PercentCall_Lo, PercentDtprel_Hi, PercentDtprel_Lo, PercentGot, PercentGot_Disp, PercentGot_Hi, PercentGot_Lo, PercentGot_Ofst, PercentGot_Page, PercentGottprel, PercentGp_Rel, PercentHi, PercentHigher, PercentHighest, PercentLo, PercentNeg, PercentPcrel_Hi, PercentPcrel_Lo, PercentTlsgd, PercentTlsldm, PercentTprel_Hi, PercentTprel_Lo } |
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 |
| SMLoc | getLoc () const |
| SMLoc | getEndLoc () const |
| SMRange | getLocRange () const |
| StringRef | getStringContents () const |
| Get the contents of a string token (without quotes). More... | |
| StringRef | getIdentifier () const |
| Get the identifier string for the current token, which should be an identifier or a string. More... | |
| StringRef | getString () const |
| Get the string for the current token, this includes all characters (for example, the quotes on strings) in the token. More... | |
| int64_t | getIntVal () const |
| APInt | getAPIntVal () const |
| void | dump (raw_ostream &OS) const |
Target independent representation for an assembler token.
Definition at line 21 of file MCAsmMacro.h.
Definition at line 23 of file MCAsmMacro.h.
|
default |
Definition at line 76 of file MCAsmMacro.h.
Definition at line 78 of file MCAsmMacro.h.
| void AsmToken::dump | ( | raw_ostream & | OS | ) | const |
Definition at line 39 of file MCAsmLexer.cpp.
References Amp, AmpAmp, At, BackSlash, BigNum, Caret, Colon, Comma, Comment, Dollar, Dot, EndOfStatement, Eof, Equal, EqualEqual, Error, Exclaim, ExclaimEqual, Greater, GreaterEqual, GreaterGreater, Hash, HashDirective, Identifier, Integer, LBrac, LCurly, Less, LessEqual, LessGreater, LessLess, LParen, Minus, MinusGreater, Percent, PercentCall16, PercentCall_Hi, PercentCall_Lo, PercentDtprel_Hi, PercentDtprel_Lo, PercentGot, PercentGot_Disp, PercentGot_Hi, PercentGot_Lo, PercentGot_Ofst, PercentGot_Page, PercentGottprel, PercentGp_Rel, PercentHi, PercentHigher, PercentHighest, PercentLo, PercentNeg, PercentPcrel_Hi, PercentPcrel_Lo, PercentTlsgd, PercentTlsldm, PercentTprel_Hi, PercentTprel_Lo, Pipe, PipePipe, Plus, RBrac, RCurly, Real, RParen, Slash, Space, Star, String, Tilde, and llvm::raw_ostream::write_escaped().
Referenced by llvm::MCAsmMacroParameter::dump(), llvm::MCAsmMacro::dump(), and getAPIntVal().
|
inline |
| SMLoc AsmToken::getEndLoc | ( | ) | const |
Definition at line 31 of file MCAsmLexer.cpp.
References llvm::SMLoc::getFromPointer().
Referenced by addNegOperand(), CheckBaseRegAndIndexRegAndScale(), insertNoDuplicates(), isNot(), MatchCoprocessorOperandName(), and matchRegisterNameHelper().
|
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 99 of file MCAsmMacro.h.
References getString(), getStringContents(), and Identifier.
Referenced by addNegOperand(), doesIgnoreDataTypeSuffix(), getPrefixes(), incrementLoc(), llvm::IsCPSRDead< MCInst >(), isMatchingOrAlias(), isOperator(), isSDKVersionToken(), isValidEncoding(), matchRegisterNameHelper(), matchSVEPredicateVectorRegName(), printMCExpr(), and RefineErrorLoc().
|
inline |
Definition at line 115 of file MCAsmMacro.h.
References assert(), llvm::APInt::getZExtValue(), and Integer.
Referenced by CheckBaseRegAndIndexRegAndScale(), insertNoDuplicates(), llvm::IsCPSRDead< MCInst >(), matchSVEPredicateVectorRegName(), llvm::MCAsmParser::parseIntToken(), and RefineErrorLoc().
|
inline |
Definition at line 81 of file MCAsmMacro.h.
Referenced by encodeCnt(), hasGOTReference(), llvm::MCAsmParser::parseOptionalToken(), and RefineErrorLoc().
| SMLoc AsmToken::getLoc | ( | ) | const |
Definition at line 27 of file MCAsmLexer.cpp.
References llvm::SMLoc::getFromPointer().
Referenced by addNegOperand(), CheckBaseRegAndIndexRegAndScale(), checkScale(), getGNUBinOpPrecedence(), getPrefixes(), insertNoDuplicates(), llvm::IsCPSRDead< MCInst >(), isMatchingOrAlias(), isNot(), isOperator(), isValidEncoding(), MatchCoprocessorOperandName(), matchRegisterNameHelper(), matchSVEPredicateVectorRegName(), llvm::MCParserUtils::parseAssignmentExpression(), llvm::MCTargetAsmParser::ParseInstruction(), llvm::MCAsmParser::parseTokenLoc(), previousIsLoop(), printMCExpr(), RefineErrorLoc(), and setRequiredFeatureString().
| SMRange AsmToken::getLocRange | ( | ) | const |
Definition at line 35 of file MCAsmLexer.cpp.
References llvm::MCAsmLexer::getLoc().
Referenced by isNot(), and RefineErrorLoc().
|
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 110 of file MCAsmMacro.h.
Referenced by addNegOperand(), CheckBaseRegAndIndexRegAndScale(), encodeCnt(), getIdentifier(), getPrefixes(), getRegNum(), hasGOTReference(), insertNoDuplicates(), llvm::IsCPSRDead< MCInst >(), MatchCoprocessorOperandName(), matchRegisterNameHelper(), matchSVEPredicateVectorRegName(), previousIsLoop(), RefineErrorLoc(), and setRequiredFeatureString().
|
inline |
Get the contents of a string token (without quotes).
Definition at line 90 of file MCAsmMacro.h.
References assert(), llvm::StringRef::size(), llvm::StringRef::slice(), and String.
Referenced by getIdentifier(), and llvm::IsCPSRDead< MCInst >().
Definition at line 82 of file MCAsmMacro.h.
Referenced by CheckBaseRegAndIndexRegAndScale(), doesIgnoreDataTypeSuffix(), encodeCnt(), getRegNum(), hasGOTReference(), insertNoDuplicates(), llvm::IsCPSRDead< MCInst >(), isOperator(), isSDKVersionToken(), MatchCoprocessorOperandName(), matchSVEPredicateVectorRegName(), llvm::AsmLexer::peekTokens(), RefineErrorLoc(), and setRequiredFeatureString().
Definition at line 83 of file MCAsmMacro.h.
References getEndLoc(), getLoc(), and getLocRange().
Referenced by addNegOperand(), CheckBaseRegAndIndexRegAndScale(), insertNoDuplicates(), llvm::IsCPSRDead< MCInst >(), MatchCoprocessorOperandName(), matchRegisterNameHelper(), matchSVEPredicateVectorRegName(), RefineErrorLoc(), and setRequiredFeatureString().
1.8.13