Lines Matching defs:Tok
238 void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const {
239 llvm::errs() << tok::getTokenName(Tok.getKind());
241 if (!Tok.isAnnotation())
242 llvm::errs() << " '" << getSpelling(Tok) << "'";
247 if (Tok.isAtStartOfLine())
249 if (Tok.hasLeadingSpace())
251 if (Tok.isExpandDisabled())
253 if (Tok.needsCleaning()) {
254 const char *Start = SourceMgr.getCharacterData(Tok.getLocation());
255 llvm::errs() << " [UnClean='" << StringRef(Start, Tok.getLength())
260 DumpLocation(Tok.getLocation());
469 StringRef Preprocessor::getSpelling(const Token &Tok,
473 if (Tok.isNot(tok::raw_identifier) && !Tok.hasUCN()) {
475 if (const IdentifierInfo *II = Tok.getIdentifierInfo())
480 if (Tok.needsCleaning())
481 Buffer.resize(Tok.getLength());
484 unsigned Len = getSpelling(Tok, Ptr, Invalid);
491 void Preprocessor::CreateString(StringRef Str, Token &Tok,
494 Tok.setLength(Str.size());
502 Tok.setLocation(Loc);
505 if (Tok.is(tok::raw_identifier))
506 Tok.setRawIdentifierData(DestPtr);
507 else if (Tok.isLiteral())
508 Tok.setLiteralData(DestPtr);
646 Token Tok;
650 CurLexerCallback(*this, Tok);
651 if (Tok.is(tok::eof) && !InPredefines) {
980 Token Tok;
981 Lex(Tok);
982 if (Tok.isOneOf(tok::unknown, tok::eof, tok::eod,
986 Tokens->push_back(Tok);
1391 bool Preprocessor::parseSimpleIntegerLiteral(Token &Tok, uint64_t &Value) {
1392 assert(Tok.is(tok::numeric_constant));
1395 StringRef Spelling = getSpelling(Tok, IntegerBuffer, &NumberInvalid);
1398 NumericLiteralParser Literal(Spelling, Tok.getLocation(), getSourceManager(),
1406 Lex(Tok);