Lines Matching defs:Tok

313   Token Tok;
315 CurLexer->Lex(Tok);
317 if (Tok.is(tok::code_completion)) {
325 if (Tok.is(tok::eof)) {
340 if (Tok.isNot(tok::hash) || !Tok.isAtStartOfLine())
351 LexUnexpandedToken(Tok);
355 if (Tok.isNot(tok::raw_identifier)) {
367 StringRef RI = Tok.getRawIdentifier();
379 // that we can't use Tok.getIdentifierInfo() because its lookup is disabled
383 if (!Tok.needsCleaning() && RI.size() < 20) {
386 std::string DirectiveStr = getSpelling(Tok);
406 CurPPLexer->pushConditionalLevel(Tok.getLocation(), /*wasskipping*/true,
427 Callbacks->Endif(Tok.getLocation(), CondInfo.IfLoc);
439 if (CondInfo.FoundElse) Diag(Tok, diag::pp_err_else_after_else);
454 Callbacks->Else(Tok.getLocation(), CondInfo.IfLoc);
463 if (CondInfo.FoundElse) Diag(Tok, diag::pp_err_elif_after_else);
480 Callbacks->Elif(Tok.getLocation(),
505 Callbacks->SourceRangeSkipped(SourceRange(BeginLoc, Tok.getLocation()));
528 Token Tok;
529 LexUnexpandedToken(Tok);
533 tok::PPKeywordKind K = Tok.getIdentifierInfo()->getPPKeywordID();
564 Diag(Tok, diag::pp_err_elif_after_else);
1001 void Preprocessor::HandleLineDirective(Token &Tok) {
1220 void Preprocessor::HandleUserDiagnosticDirective(Token &Tok,
1239 Diag(Tok, diag::pp_hash_warning) << Msg;
1241 Diag(Tok, diag::err_pp_hash_error) << Msg;
1246 void Preprocessor::HandleIdentSCCSDirective(Token &Tok) {
1248 Diag(Tok, diag::ext_pp_ident_directive);
1275 Callbacks->Ident(Tok.getLocation(), Str);
1280 void Preprocessor::HandleMacroPublicDirective(Token &Tok) {
1307 void Preprocessor::HandleMacroPrivateDirective(Token &Tok) {
1447 Token *Tok = new Token[1];
1448 Tok[0].startToken();
1449 Tok[0].setKind(Kind);
1450 Tok[0].setLocation(Begin);
1451 Tok[0].setAnnotationEndLoc(End);
1452 Tok[0].setAnnotationValue(AnnotationVal);
1453 PP.EnterTokenStream(Tok, 1, true, true);
1827 void Preprocessor::HandleMicrosoftImportDirective(Token &Tok) {
1833 Diag(Tok, diag::err_pp_import_directive_ms );
1887 bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI, Token &Tok) {
1891 LexUnexpandedToken(Tok);
1892 switch (Tok.getKind()) {
1898 Diag(Tok, diag::err_pp_expected_ident_in_arg_list);
1902 Diag(Tok, LangOpts.CPlusPlus11 ?
1908 Diag(Tok, diag::err_pp_opencl_variadic_macros);
1913 LexUnexpandedToken(Tok);
1914 if (Tok.isNot(tok::r_paren)) {
1915 Diag(Tok, diag::err_pp_missing_rparen_in_macro_def);
1924 Diag(Tok, diag::err_pp_missing_rparen_in_macro_def);
1929 IdentifierInfo *II = Tok.getIdentifierInfo();
1932 Diag(Tok, diag::err_pp_invalid_tok_in_arg_list);
1940 Diag(Tok, diag::err_pp_duplicate_name_in_arg_list) << II;
1948 LexUnexpandedToken(Tok);
1950 switch (Tok.getKind()) {
1952 Diag(Tok, diag::err_pp_expected_comma_in_arg_list);
1961 Diag(Tok, diag::ext_named_variadic_macro);
1964 LexUnexpandedToken(Tok);
1965 if (Tok.isNot(tok::r_paren)) {
1966 Diag(Tok, diag::err_pp_missing_rparen_in_macro_def);
2047 Token Tok;
2048 LexUnexpandedToken(Tok);
2053 if (Tok.is(tok::eod)) {
2060 } else if (Tok.hasLeadingSpace()) {
2063 Tok.clearFlag(Token::LeadingSpace);
2064 } else if (Tok.is(tok::l_paren)) {
2084 LexUnexpandedToken(Tok);
2088 Diag(Tok, diag::ext_c99_whitespace_required_after_macro_name);
2097 if (Tok.is(tok::at)) // @ is not in the list above.
2099 else if (Tok.is(tok::unknown)) {
2106 Diag(Tok, diag::ext_missing_whitespace_after_macro_name);
2108 Diag(Tok, diag::warn_missing_whitespace_after_macro_name);
2111 if (!Tok.is(tok::eod))
2112 LastTok = Tok;
2117 while (Tok.isNot(tok::eod)) {
2118 LastTok = Tok;
2119 MI->AddTokenToBody(Tok);
2121 LexUnexpandedToken(Tok);
2128 while (Tok.isNot(tok::eod)) {
2129 LastTok = Tok;
2131 if (Tok.isNot(tok::hash) && Tok.isNot(tok::hashhash)) {
2132 MI->AddTokenToBody(Tok);
2135 LexUnexpandedToken(Tok);
2143 Tok.setKind(tok::unknown);
2144 MI->AddTokenToBody(Tok);
2147 LexUnexpandedToken(Tok);
2151 if (Tok.is(tok::hashhash)) {
2158 LexUnexpandedToken(Tok);
2160 if (Tok.is(tok::eod)) {
2166 if (NumTokens && Tok.getIdentifierInfo() == Ident__VA_ARGS__ &&
2176 LexUnexpandedToken(Tok);
2179 if (Tok.getIdentifierInfo() == nullptr ||
2180 MI->getArgumentNum(Tok.getIdentifierInfo()) == -1) {
2186 if (getLangOpts().AsmPreprocessor && Tok.isNot(tok::eod)) {
2191 Diag(Tok, diag::err_pp_stringize_not_parameter);
2201 MI->AddTokenToBody(Tok);
2202 LastTok = Tok;
2205 LexUnexpandedToken(Tok);