Lines Matching refs:Tok
48 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
51 if (!Tok.needsCleaning()) {
52 if (Tok.getLength() < 1 || Tok.getLength() > 3)
55 const char *Ptr = SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation()));
56 return IsStringPrefix(StringRef(Ptr, Tok.getLength()),
60 if (Tok.getLength() < 256) {
63 unsigned length = PP.getSpelling(Tok, TokPtr);
67 return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11);
119 /// GetFirstChar - Get the first character of the token \arg Tok,
121 static char GetFirstChar(Preprocessor &PP, const Token &Tok) {
122 if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
125 } else if (!Tok.needsCleaning()) {
126 if (Tok.isLiteral() && Tok.getLiteralData()) {
127 return *Tok.getLiteralData();
130 return *SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation()));
132 } else if (Tok.getLength() < 256) {
135 PP.getSpelling(Tok, TokPtr);
138 return PP.getSpelling(Tok)[0];
142 /// AvoidConcat - If printing PrevTok immediately followed by Tok would cause
155 const Token &Tok) const {
161 SourceLocation SpellLoc = SM.getSpellingLoc(Tok.getLocation());
177 if (Tok.is(tok::equal) || Tok.is(tok::equalequal))
191 FirstChar = GetFirstChar(PP, Tok);
215 if (Tok.getIdentifierInfo())
225 if (Tok.is(tok::numeric_constant))
226 return GetFirstChar(PP, Tok) != '.';
228 if (Tok.getIdentifierInfo() || Tok.is(tok::wide_string_literal) ||
229 Tok.is(tok::utf8_string_literal) || Tok.is(tok::utf16_string_literal) ||
230 Tok.is(tok::utf32_string_literal) || Tok.is(tok::wide_char_constant) ||
231 Tok.is(tok::utf16_char_constant) || Tok.is(tok::utf32_char_constant))
235 if (Tok.isNot(tok::char_constant) && Tok.isNot(tok::string_literal))