;
25(
CPlusPlus11&& (Str[0] ==
'u'|| Str[0] ==
'U'|| Str[0] ==
'R'))) {
32 if(Str[1] ==
'R'&& Str[0] !=
'R'&& Str.size() == 2 &&
CPlusPlus11)
36 if(Str[0] ==
'u'&& Str[1] ==
'8') {
37 if(Str.size() == 2)
return true;
38 if(Str.size() == 3 && Str[2] ==
'R')
return true;
47boolTokenConcatenation::IsIdentifierStringPrefix(
const Token&Tok)
const{
54 const char*Ptr =
SM.getCharacterData(
SM.getSpellingLoc(Tok.
getLocation()));
56LangOpts.CPlusPlus11);
61 const char*TokPtr = Buffer;
70 memset(TokenInfo, 0,
sizeof(TokenInfo));
73TokenInfo[tok::identifier ] |= aci_custom;
74TokenInfo[tok::numeric_constant] |= aci_custom_firstchar;
75TokenInfo[tok::period ] |= aci_custom_firstchar;
76TokenInfo[tok::amp ] |= aci_custom_firstchar;
77TokenInfo[tok::plus ] |= aci_custom_firstchar;
78TokenInfo[tok::minus ] |= aci_custom_firstchar;
79TokenInfo[tok::slash ] |= aci_custom_firstchar;
80TokenInfo[tok::less ] |= aci_custom_firstchar;
81TokenInfo[tok::greater ] |= aci_custom_firstchar;
82TokenInfo[tok::pipe ] |= aci_custom_firstchar;
83TokenInfo[tok::percent ] |= aci_custom_firstchar;
84TokenInfo[tok::colon ] |= aci_custom_firstchar;
85TokenInfo[tok::hash ] |= aci_custom_firstchar;
86TokenInfo[tok::arrow ] |= aci_custom_firstchar;
90TokenInfo[tok::string_literal ] |= aci_custom;
91TokenInfo[tok::wide_string_literal ] |= aci_custom;
92TokenInfo[tok::utf8_string_literal ] |= aci_custom;
93TokenInfo[tok::utf16_string_literal] |= aci_custom;
94TokenInfo[tok::utf32_string_literal] |= aci_custom;
95TokenInfo[tok::char_constant ] |= aci_custom;
96TokenInfo[tok::wide_char_constant ] |= aci_custom;
97TokenInfo[tok::utf16_char_constant ] |= aci_custom;
98TokenInfo[tok::utf32_char_constant ] |= aci_custom;
103TokenInfo[tok::utf8_char_constant] |= aci_custom;
107TokenInfo[tok::lessequal ] |= aci_custom_firstchar;
110TokenInfo[tok::amp ] |= aci_avoid_equal;
111TokenInfo[tok::plus ] |= aci_avoid_equal;
112TokenInfo[tok::minus ] |= aci_avoid_equal;
113TokenInfo[tok::slash ] |= aci_avoid_equal;
114TokenInfo[tok::less ] |= aci_avoid_equal;
115TokenInfo[tok::greater ] |= aci_avoid_equal;
116TokenInfo[tok::pipe ] |= aci_avoid_equal;
117TokenInfo[tok::percent ] |= aci_avoid_equal;
118TokenInfo[tok::star ] |= aci_avoid_equal;
119TokenInfo[tok::exclaim ] |= aci_avoid_equal;
120TokenInfo[tok::lessless ] |= aci_avoid_equal;
121TokenInfo[tok::greatergreater] |= aci_avoid_equal;
122TokenInfo[tok::caret ] |= aci_avoid_equal;
123TokenInfo[tok::equal ] |= aci_avoid_equal;
131 returnII->getNameStart()[0];
137 return*
SM.getCharacterData(
SM.getSpellingLoc(Tok.
getLocation()));
141 const char*TokPtr = Buffer;
161 const Token&PrevTok,
162 const Token&Tok)
const{
164 if(PrevTok.
is(tok::annot_header_unit) && Tok.
is(tok::semi))
183PrevKind = tok::identifier;
186 unsignedConcatInfo = TokenInfo[PrevKind];
189 if(ConcatInfo == 0)
return false;
191 if(ConcatInfo & aci_avoid_equal) {
193 if(Tok.
isOneOf(tok::equal, tok::equalequal))
195ConcatInfo &= ~aci_avoid_equal;
199assert(Tok.
isOneOf(tok::annot_module_include, tok::annot_module_begin,
200tok::annot_module_end, tok::annot_embed) &&
201 "unexpected annotation in AvoidConcat");
204 if(Tok.
is(tok::annot_embed))
215 if(ConcatInfo & aci_custom) {
223llvm_unreachable(
"InitAvoidConcatTokenInfo built wrong");
225 casetok::raw_identifier:
226llvm_unreachable(
"tok::raw_identifier in non-raw lexing mode!");
228 casetok::string_literal:
229 casetok::wide_string_literal:
230 casetok::utf8_string_literal:
231 casetok::utf16_string_literal:
232 casetok::utf32_string_literal:
233 casetok::char_constant:
234 casetok::wide_char_constant:
235 casetok::utf8_char_constant:
236 casetok::utf16_char_constant:
237 casetok::utf32_char_constant:
251 casetok::identifier:
253 if(Tok.
is(tok::numeric_constant))
257Tok.
isOneOf(tok::wide_string_literal, tok::utf8_string_literal,
258tok::utf16_string_literal, tok::utf32_string_literal,
259tok::wide_char_constant, tok::utf8_char_constant,
260tok::utf16_char_constant, tok::utf32_char_constant))
264 if(Tok.
isNot(tok::char_constant) && Tok.
isNot(tok::string_literal))
269 returnIsIdentifierStringPrefix(PrevTok);
271 casetok::numeric_constant:
273FirstChar ==
'+'|| FirstChar ==
'-';
275 return(FirstChar ==
'.'&& PrevPrevTok.
is(tok::period)) ||
277(PP.
getLangOpts().CPlusPlus && FirstChar ==
'*');
279 returnFirstChar ==
'&';
281 returnFirstChar ==
'+';
283 returnFirstChar ==
'-'|| FirstChar ==
'>';
285 returnFirstChar ==
'*'|| FirstChar ==
'/';
287 returnFirstChar ==
'<'|| FirstChar ==
':'|| FirstChar ==
'%';
289 returnFirstChar ==
'>';
291 returnFirstChar ==
'|';
293 returnFirstChar ==
'>'|| FirstChar ==
':';
295 returnFirstChar ==
'>'||
296(PP.
getLangOpts().CPlusPlus && FirstChar ==
':');
298 returnFirstChar ==
'#'|| FirstChar ==
'@'|| FirstChar ==
'%';
300 returnPP.
getLangOpts().CPlusPlus && FirstChar ==
'*';
302 returnPP.
getLangOpts().CPlusPlus20 && FirstChar ==
'>';
Defines the clang::Preprocessor interface.
static char GetFirstChar(const Preprocessor &PP, const Token &Tok)
GetFirstChar - Get the first character of the token.
static bool IsStringPrefix(StringRef Str, bool CPlusPlus11)
IsStringPrefix - Return true if Str is a string prefix.
__DEVICE__ void * memset(void *__a, int __b, size_t __c)
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
SourceManager & getSourceManager() const
StringRef getSpelling(SourceLocation loc, SmallVectorImpl< char > &buffer, bool *invalid=nullptr) const
Return the 'spelling' of the token at the given location; does not go up to the spelling location or ...
const LangOptions & getLangOpts() const
Encodes a location in the source.
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
This class handles loading and caching of source files into memory.
TokenConcatenation(const Preprocessor &PP)
bool AvoidConcat(const Token &PrevPrevTok, const Token &PrevTok, const Token &Tok) const
AvoidConcat - If printing PrevTok immediately followed by Tok would cause the two individual tokens t...
Token - This structure provides full information about a lexed token.
IdentifierInfo * getIdentifierInfo() const
bool isLiteral() const
Return true if this is a "literal", like a numeric constant, string, etc.
SourceLocation getLocation() const
Return a source location identifier for the specified offset in the current file.
unsigned getLength() const
bool is(tok::TokenKind K) const
is/isNot - Predicates to check if this token is a specific kind, as in "if (Tok.is(tok::l_brace)) {....
tok::TokenKind getKind() const
bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const
bool isNot(tok::TokenKind K) const
bool isAnnotation() const
Return true if this is any of tok::annot_* kind tokens.
bool hasUDSuffix() const
Return true if this token is a string or character literal which has a ud-suffix.
bool needsCleaning() const
Return true if this token has trigraphs or escaped newlines in it.
const char * getLiteralData() const
getLiteralData - For a literal token (numeric constant, string, etc), this returns a pointer to the s...
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
The JSON file list parser is used to communicate input to InstallAPI.
LLVM_READONLY bool isDigit(unsigned char c)
Return true if this character is an ASCII digit: [0-9].
LLVM_READONLY bool isPreprocessingNumberBody(unsigned char c)
Return true if this is the body character of a C preprocessing number, which is [a-zA-Z0-9_.
float __ovld __cnfn length(float)
Return the length of vector p, i.e., sqrt(p.x2 + p.y 2 + ...)
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