• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Lex/

Lines Matching refs:Tok

47 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
50 if (!Tok.needsCleaning()) {
51 if (Tok.getLength() < 1 || Tok.getLength() > 3)
54 const char *Ptr = SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation()));
55 return IsStringPrefix(StringRef(Ptr, Tok.getLength()),
59 if (Tok.getLength() < 256) {
62 unsigned length = PP.getSpelling(Tok, TokPtr);
66 return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11);
126 /// GetFirstChar - Get the first character of the token \arg Tok,
128 static char GetFirstChar(const Preprocessor &PP, const Token &Tok) {
129 if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
132 } else if (!Tok.needsCleaning()) {
133 if (Tok.isLiteral() && Tok.getLiteralData()) {
134 return *Tok.getLiteralData();
137 return *SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation()));
139 } else if (Tok.getLength() < 256) {
142 PP.getSpelling(Tok, TokPtr);
145 return PP.getSpelling(Tok)[0];
149 /// AvoidConcat - If printing PrevTok immediately followed by Tok would cause
162 const Token &Tok) const {
173 SourceLocation SpellLoc = SM.getSpellingLoc(Tok.getLocation());
189 if (Tok.isOneOf(tok::equal, tok::equalequal))
193 if (Tok.isAnnotation()) {
195 assert(Tok.isOneOf(tok::annot_module_include, tok::annot_module_begin,
211 FirstChar = GetFirstChar(PP, Tok);
236 if (Tok.getIdentifierInfo())
246 if (Tok.is(tok::numeric_constant))
247 return GetFirstChar(PP, Tok) != '.';
249 if (Tok.getIdentifierInfo() ||
250 Tok.isOneOf(tok::wide_string_literal, tok::utf8_string_literal,
257 if (Tok.isNot(tok::char_constant) && Tok.isNot(tok::string_literal))