: PP(
P), Ident__VA_ARGS__(PP.Ident__VA_ARGS__),
38Ident__VA_OPT__(PP.Ident__VA_OPT__) {
39assert(Ident__VA_ARGS__->
isPoisoned() &&
"__VA_ARGS__ should be poisoned " 40 "outside an ISO C/C++ variadic " 41 "macro definition!");
42assert(Ident__VA_OPT__->
isPoisoned() &&
"__VA_OPT__ should be poisoned!");
75: Ident__VA_OPT__(PP.Ident__VA_OPT__) {}
78 returnIdent__VA_OPT__ &&
T.getIdentifierInfo() == Ident__VA_OPT__;
83 bool isInVAOpt()
const{
returnUnmatchedOpeningParens.size(); }
87assert(!
isInVAOpt() &&
"Must NOT be within VAOPT context to call this");
88UnmatchedOpeningParens.push_back(LParenLoc);
93assert(
isInVAOpt() &&
"Must be within VAOPT context to call this");
94 returnUnmatchedOpeningParens.back();
101assert(
isInVAOpt() &&
"Must be within VAOPT context to call this");
102UnmatchedOpeningParens.pop_back();
103 return!UnmatchedOpeningParens.size();
108assert(
isInVAOpt() &&
"Must be within VAOPT context to call this");
109UnmatchedOpeningParens.push_back(LParenLoc);
113 bool isAtTopLevel()
const{
returnUnmatchedOpeningParens.size() == 1; }
120 TokenSyntheticEOFToken;
130 intNumOfTokensPriorToVAOpt = -1;
132LLVM_PREFERRED_TYPE(
bool)
133 unsignedLeadingSpaceForStringifiedToken : 1;
135LLVM_PREFERRED_TYPE(
bool)
136 unsignedStringifyBefore : 1;
137LLVM_PREFERRED_TYPE(
bool)
138 unsignedCharifyBefore : 1;
139LLVM_PREFERRED_TYPE(
bool)
140 unsignedBeginsWithPlaceholder : 1;
141LLVM_PREFERRED_TYPE(
bool)
142 unsignedEndsWithPlaceholder : 1;
144 boolhasStringifyBefore()
const{
146 "Must only be called if the state has not been reset");
147 returnStringifyBefore;
150 boolisReset()
const{
151 returnNumOfTokensPriorToVAOpt == -1 ||
158StringifyBefore(
false), CharifyBefore(
false),
159BeginsWithPlaceholder(
false), EndsWithPlaceholder(
false) {
161SyntheticEOFToken.
setKind(tok::eof);
166NumOfTokensPriorToVAOpt = -1;
167LeadingSpaceForStringifiedToken =
false;
168StringifyBefore =
false;
169CharifyBefore =
false;
170BeginsWithPlaceholder =
false;
171EndsWithPlaceholder =
false;
177 const boolIsHashAt) {
179StringifyBefore = !IsHashAt;
180CharifyBefore = IsHashAt;
181LeadingSpaceForStringifiedToken = HasLeadingSpace;
187EndsWithPlaceholder =
true;
193 "Must only be called if the state has not been reset");
194 returnBeginsWithPlaceholder;
198 "Must only be called if the state has not been reset");
199 returnEndsWithPlaceholder;
204 "Must only be called if the state has not been reset");
205 returnCharifyBefore;
213 "Must only be called if the state has not been reset");
214 returnNumOfTokensPriorToVAOpt;
218assert(hasStringifyBefore() &&
219 "Must only be called if this has been marked for stringification");
220 returnLeadingSpaceForStringifiedToken;
224 const unsigned intNumPriorTokens) {
225assert(VAOptLoc.
isFileID() &&
"Must not come from a macro expansion");
226assert(isReset() &&
"Must only be called if the state has been reset");
228this->VAOptLoc = VAOptLoc;
229NumOfTokensPriorToVAOpt = NumPriorTokens;
230assert(NumOfTokensPriorToVAOpt > -1 &&
231 "Too many prior tokens");
236 "Must only be called if the state has not been reset");
237assert(VAOptLoc.
isValid() &&
"__VA_OPT__ location must be valid");
Defines the clang::Preprocessor interface.
One of these records is kept for each identifier that is lexed.
void setIsPoisoned(bool Value=true)
setIsPoisoned - Mark this identifier as poisoned.
bool isPoisoned() const
Return true if this token has been poisoned.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
Token - This structure provides full information about a lexed token.
void setKind(tok::TokenKind K)
void startToken()
Reset all flags to cleared.
A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a variadic mac...
VAOptDefinitionContext(Preprocessor &PP)
SourceLocation getUnmatchedOpeningParenLoc() const
bool isInVAOpt() const
Returns true if we have seen the VA_OPT and '(' but before having seen the matching ')'.
bool isVAOptToken(const Token &T) const
void sawOpeningParen(SourceLocation LParenLoc)
Call this function each time an lparen is seen.
bool isAtTopLevel() const
Are we at the top level within the VA_OPT?
bool sawClosingParen()
Call this function each time an rparen is seen.
void sawVAOptFollowedByOpeningParens(const SourceLocation LParenLoc)
Call this function as soon as you see VA_OPT and '('.
A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a macro during...
VAOptExpansionContext(Preprocessor &PP)
void hasPlaceholderAfterHashhashAtStart()
void sawHashOrHashAtBefore(const bool HasLeadingSpace, const bool IsHashAt)
SourceLocation getVAOptLoc() const
unsigned int getNumberOfTokensPriorToVAOpt() const
bool getLeadingSpaceForStringifiedToken() const
bool hasStringifyOrCharifyBefore() const
bool hasCharifyBefore() const
void hasPlaceholderBeforeRParen()
const Token & getEOFTok() const
bool beginsWithPlaceholder() const
bool endsWithPlaceholder() const
void sawVAOptFollowedByOpeningParens(const SourceLocation VAOptLoc, const unsigned int NumPriorTokens)
An RAII class that tracks when the Preprocessor starts and stops lexing the definition of a (ISO C/C+...
void exitScope()
Client code should call this function as soon as the Preprocessor has either completed lexing the mac...
void enterScope()
Client code should call this function just before the Preprocessor is about to Lex tokens from the de...
~VariadicMacroScopeGuard()
VariadicMacroScopeGuard(const Preprocessor &P)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4