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

Lines Matching defs:Tok

271 static size_t getSpellingSlow(const Token &Tok, const char *BufPtr,
273 assert(Tok.needsCleaning() && "getSpellingSlow called on simple token");
276 const char *BufEnd = BufPtr + Tok.getLength();
278 if (tok::isStringLiteral(Tok.getKind())) {
315 assert(Length < Tok.getLength() &&
366 std::string Lexer::getSpelling(const Token &Tok, const SourceManager &SourceMgr,
368 assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
371 const char *TokStart = SourceMgr.getCharacterData(Tok.getLocation(),
379 if (!Tok.needsCleaning())
380 return std::string(TokStart, TokStart + Tok.getLength());
383 Result.resize(Tok.getLength());
384 Result.resize(getSpellingSlow(Tok, TokStart, LangOpts, &*Result.begin()));
391 /// Tok.getLength() bytes long. The actual length of the token is returned.
398 unsigned Lexer::getSpelling(const Token &Tok, const char *&Buffer,
401 assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
405 if (Tok.is(tok::raw_identifier))
406 TokStart = Tok.getRawIdentifier().data();
407 else if (!Tok.hasUCN()) {
408 if (const IdentifierInfo *II = Tok.getIdentifierInfo()) {
416 if (Tok.isLiteral())
417 TokStart = Tok.getLiteralData();
422 TokStart = SourceMgr.getCharacterData(Tok.getLocation(), &CharDataInvalid);
432 if (!Tok.needsCleaning()) {
434 return Tok.getLength();
438 return getSpellingSlow(Tok, TokStart, LangOpts, const_cast<char*>(Buffer));
1262 Token Tok;
1263 lexer.LexFromRawLexer(Tok);
1264 return Tok;
1274 Optional<Token> Tok = findNextToken(Loc, SM, LangOpts);
1275 if (!Tok || Tok->isNot(TKind))
1277 SourceLocation TokenLoc = Tok->getLocation();
1282 const char *TokenEnd = SM.getCharacterData(TokenLoc) + Tok->getLength();
1299 return TokenLoc.getLocWithOffset(Tok->getLength() + NumWhitespaceChars);
1318 Token *Tok) {
1331 if (Tok) Tok->setFlag(Token::NeedsCleaning);
1334 if (Ptr[0] != '\n' && Ptr[0] != '\r' && Tok && !isLexingRawMode())
1342 return getCharAndSizeSlow(Ptr, Size, Tok);
1353 if (char C = DecodeTrigraphChar(Ptr+2, Tok ? this : nullptr)) {
1355 if (Tok) Tok->setFlag(Token::NeedsCleaning);
2808 Token Tok;
2809 Lex(Tok);
2821 if (Tok.is(tok::eof))
2823 return Tok.is(tok::l_paren);