Lines Matching refs:Tok

172   tok::TokenKind Kind  = Tok.getKind();
205 if (Tok.is(tok::semi))
211 if (Tok.isNot(tok::identifier))
220 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
226 if (Tok.is(tok::r_brace)) {
227 Diag(Tok, diag::err_expected_statement);
242 bool HasLeadingEmptyMacro = Tok.hasLeadingEmptyMacro();
331 Diag(Tok, diag::err_pragma_fp_contract_scope);
351 if (Tok.is(tok::semi)) {
368 Token OldToken = Tok;
377 if (Tok.is(tok::semi))
382 if (Tok.is(tok::colon) && getCurScope()->isSwitchScope() &&
399 assert(Tok.is(tok::kw___try) && "Expected '__try'");
414 if(Tok.isNot(tok::l_brace))
415 return StmtError(Diag(Tok,diag::err_expected_lbrace));
422 if (Tok.is(tok::identifier) &&
423 Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
426 } else if (Tok.is(tok::kw___finally)) {
430 return StmtError(Diag(Tok,diag::err_seh_expected_handler));
508 assert(Tok.is(tok::identifier) && Tok.getIdentifierInfo() &&
511 Token IdentTok = Tok; // Save the whole token.
514 assert(Tok.is(tok::colon) && "Not a label!");
521 if (Tok.is(tok::kw___attribute)) {
532 if (!getLangOpts().CPlusPlus || Tok.is(tok::semi))
546 Diag(Tok, diag::err_expected_semi_after) << "__attribute__";
575 assert((MissingCase || Tok.is(tok::kw_case)) && "Not a case stmt!");
606 if (Tok.is(tok::code_completion)) {
627 if (Tok.is(tok::ellipsis)) {
628 Diag(Tok, diag::ext_gnu_case_range);
640 if (Tok.is(tok::colon)) {
644 } else if (Tok.is(tok::semi)) {
677 } while (Tok.is(tok::kw_case));
684 if (Tok.isNot(tok::r_brace)) {
712 assert(Tok.is(tok::kw_default) && "Not a default stmt!");
716 if (Tok.is(tok::colon)) {
720 } else if (Tok.is(tok::semi)) {
733 if (Tok.isNot(tok::r_brace)) {
785 assert(Tok.is(tok::l_brace) && "Not a compount stmt!");
801 switch (Tok.getKind()) {
843 Tok.getLocation(),
864 while (Tok.is(tok::kw___label__)) {
869 if (Tok.isNot(tok::identifier)) {
870 Diag(Tok, diag::err_expected_ident);
874 IdentifierInfo *II = Tok.getIdentifierInfo();
878 if (!Tok.is(tok::comma))
886 StmtResult R = Actions.ActOnDeclStmt(Res, LabelLoc, Tok.getLocation());
893 while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
894 if (Tok.is(tok::annot_pragma_unused)) {
899 if (getLangOpts().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
900 Tok.is(tok::kw___if_not_exists))) {
906 if (Tok.isNot(tok::kw___extension__)) {
914 while (Tok.is(tok::kw___extension__))
926 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
952 SourceLocation CloseLoc = Tok.getLocation();
997 if (ExprResult.isInvalid() && !DeclResult && Tok.isNot(tok::r_paren)) {
1001 if (Tok.isNot(tok::r_paren))
1011 while (Tok.is(tok::r_paren)) {
1012 Diag(Tok, diag::err_extraneous_rparen_in_condition)
1013 << FixItHint::CreateRemoval(Tok.getLocation());
1029 assert(Tok.is(tok::kw_if) && "Not an if stmt!");
1032 if (Tok.isNot(tok::l_paren)) {
1033 Diag(Tok, diag::err_expected_lparen_after) << "if";
1081 C99orCXX && Tok.isNot(tok::l_brace));
1084 SourceLocation ThenStmtLoc = Tok.getLocation();
1097 if (Tok.is(tok::kw_else)) {
1099 *TrailingElseLoc = Tok.getLocation();
1102 ElseStmtLoc = Tok.getLocation();
1114 C99orCXX && Tok.isNot(tok::l_brace));
1120 } else if (Tok.is(tok::code_completion)) {
1155 assert(Tok.is(tok::kw_switch) && "Not a switch stmt!");
1158 if (Tok.isNot(tok::l_paren)) {
1159 Diag(Tok, diag::err_expected_lparen_after) << "switch";
1197 if (Tok.is(tok::l_brace)) {
1217 C99orCXX && Tok.isNot(tok::l_brace));
1243 assert(Tok.is(tok::kw_while) && "Not a while stmt!");
1244 SourceLocation WhileLoc = Tok.getLocation();
1247 if (Tok.isNot(tok::l_paren)) {
1248 Diag(Tok, diag::err_expected_lparen_after) << "while";
1295 C99orCXX && Tok.isNot(tok::l_brace));
1315 assert(Tok.is(tok::kw_do) && "Not a do stmt!");
1338 Tok.isNot(tok::l_brace));
1346 if (Tok.isNot(tok::kw_while)) {
1348 Diag(Tok, diag::err_expected_while);
1356 if (Tok.isNot(tok::l_paren)) {
1357 Diag(Tok, diag::err_expected_lparen_after) << "do/while";
1400 assert(Tok.is(tok::kw_for) && "Not a for stmt!");
1403 if (Tok.isNot(tok::l_paren)) {
1404 Diag(Tok, diag::err_expected_lparen_after) << "for";
1450 if (Tok.is(tok::code_completion)) {
1462 if (Tok.is(tok::semi)) { // for (;
1469 Diag(Tok, diag::ext_c99_variable_decl_in_for_loop);
1475 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
1481 FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation());
1488 } else if (Tok.is(tok::semi)) { // for (int x = 4;
1495 if (Tok.is(tok::code_completion)) {
1502 Diag(Tok, diag::err_expected_semi_for);
1518 if (Tok.is(tok::semi)) {
1523 if (Tok.is(tok::code_completion)) {
1529 } else if (getLangOpts().CPlusPlus11 && Tok.is(tok::colon) && FirstPart.get()) {
1532 Diag(Tok, diag::err_for_range_expected_decl)
1538 Diag(Tok, diag::err_expected_semi_for);
1542 if (Tok.is(tok::semi))
1550 if (Tok.is(tok::semi)) { // for (...;;
1552 } else if (Tok.is(tok::r_paren)) {
1568 if (Tok.isNot(tok::semi)) {
1570 Diag(Tok, diag::err_expected_semi_for);
1576 if (Tok.is(tok::semi)) {
1581 if (Tok.isNot(tok::r_paren)) { // for (...;...;)
1626 C99orCXXorObjC && Tok.isNot(tok::l_brace));
1660 assert(Tok.is(tok::kw_goto) && "Not a goto stmt!");
1664 if (Tok.is(tok::identifier)) {
1665 LabelDecl *LD = Actions.LookupOrCreateLabel(Tok.getIdentifierInfo(),
1666 Tok.getLocation());
1667 Res = Actions.ActOnGotoStmt(GotoLoc, Tok.getLocation(), LD);
1669 } else if (Tok.is(tok::star)) {
1671 Diag(Tok, diag::ext_gnu_indirect_goto);
1680 Diag(Tok, diag::err_expected_ident);
1713 assert(Tok.is(tok::kw_return) && "Not a return stmt!");
1717 if (Tok.isNot(tok::semi)) {
1718 if (Tok.is(tok::code_completion)) {
1724 if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus) {
1865 const Token &Tok = AsmToks[TokIndex];
1866 Loc = Tok.getLocation();
1896 LineToks.push_back(Tok);
1925 if (Invalid || Tok.is(EndOfStream)) {
1932 while (LineToks[LineIndex].getLocation() != Tok.getLocation()) {
1970 const Token &Tok = AsmToks[i];
1974 (Tok.is(tok::kw_asm) || Tok.isAtStartOfLine())) {
1981 if (!isNewStatement && Tok.hasLeadingSpace())
1988 if (Tok.is(tok::kw_asm)) {
2001 Asm += PP.getSpelling(Tok, SpellingBuffer, &SpellingInvalid);
2044 if (Tok.is(tok::l_brace)) {
2058 SourceLocation TokLoc = Tok.getLocation();
2061 if (Tok.is(tok::eof))
2064 if (!InAsmComment && Tok.is(tok::semi)) {
2086 } else if (!InAsmComment && Tok.is(tok::r_brace)) {
2093 if (!InAsmComment && InBraces && Tok.is(tok::r_brace) &&
2104 PP.Lex(Tok);
2106 AsmToks.push_back(Tok);
2109 TokLoc = Tok.getLocation();
2115 Diag(Tok, diag::err_expected_rbrace);
2120 Diag(Tok, diag::err_expected_lbrace);
2257 assert(Tok.is(tok::kw_asm) && "Not an asm stmt");
2260 if (getLangOpts().AsmBlocks && Tok.isNot(tok::l_paren) &&
2266 SourceLocation Loc = Tok.getLocation();
2280 if (Tok.isNot(tok::l_paren)) {
2281 Diag(Tok, diag::err_expected_lparen_after) << "asm";
2300 if (Tok.is(tok::r_paren)) {
2311 if (Tok.is(tok::colon) || Tok.is(tok::coloncolon)) {
2313 AteExtraColon = Tok.is(tok::coloncolon);
2325 Tok.is(tok::colon) || Tok.is(tok::coloncolon)) {
2330 AteExtraColon = Tok.is(tok::coloncolon);
2346 if (AteExtraColon || Tok.is(tok::colon)) {
2351 if (Tok.isNot(tok::r_paren)) {
2360 if (Tok.isNot(tok::comma)) break;
2390 if (!isTokenStringLiteral() && Tok.isNot(tok::l_square))
2395 if (Tok.is(tok::l_square)) {
2399 if (Tok.isNot(tok::identifier)) {
2400 Diag(Tok, diag::err_expected_ident);
2405 IdentifierInfo *II = Tok.getIdentifierInfo();
2420 if (Tok.isNot(tok::l_paren)) {
2421 Diag(Tok, diag::err_expected_lparen_after) << "asm operand";
2437 if (Tok.isNot(tok::comma)) return false;
2443 assert(Tok.is(tok::l_brace));
2444 SourceLocation LBraceLoc = Tok.getLocation();
2476 assert(Tok.is(tok::kw_try) && "Expected 'try'");
2483 if (Tok.is(tok::colon))
2494 SourceLocation LBraceLoc = Tok.getLocation();
2508 assert(Tok.is(tok::l_brace));
2537 assert(Tok.is(tok::kw_try) && "Expected 'try'");
2560 if (Tok.isNot(tok::l_brace))
2561 return StmtError(Diag(Tok, diag::err_expected_lbrace));
2572 if ((Tok.is(tok::identifier) &&
2573 Tok.getIdentifierInfo() == getSEHExceptKeyword()) ||
2574 Tok.is(tok::kw___finally)) {
2577 if(Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
2600 if (Tok.isNot(tok::kw_catch))
2601 return StmtError(Diag(Tok, diag::err_expected_catch));
2602 while (Tok.is(tok::kw_catch)) {
2627 assert(Tok.is(tok::kw_catch) && "Expected 'catch'");
2644 if (Tok.isNot(tok::ellipsis)) {
2664 if (Tok.isNot(tok::l_brace))
2665 return StmtError(Diag(Tok, diag::err_expected_lbrace));
2685 if (!Tok.is(tok::l_brace)) {
2686 Diag(Tok, diag::err_expected_lbrace);
2706 Diag(Tok, diag::err_expected_lbrace);
2724 while (Tok.isNot(tok::r_brace)) {