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

Lines Matching defs:Tok

163   tok::TokenKind Kind  = Tok.getKind();
195 if (Tok.is(tok::semi))
201 if (Tok.isNot(tok::identifier))
214 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
229 if (Tok.is(tok::r_brace)) {
230 Diag(Tok, diag::err_expected_statement);
238 GNUAttributeLoc = Tok.getLocation();
251 bool HasLeadingEmptyMacro = Tok.hasLeadingEmptyMacro();
357 Diag(Tok, diag::err_pragma_file_or_compound_scope) << "fp_contract";
363 Diag(Tok, diag::err_pragma_file_or_compound_scope) << "clang fp";
374 Diag(Tok, diag::err_pragma_file_or_compound_scope) << "float_control";
435 Token OldToken = Tok;
437 ExprStatementTokLoc = Tok.getLocation();
446 if (Tok.is(tok::semi))
451 if (Tok.is(tok::colon) && getCurScope()->isSwitchScope() &&
477 assert(Tok.is(tok::kw___try) && "Expected '__try'");
480 if (Tok.isNot(tok::l_brace))
481 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
490 if (Tok.is(tok::identifier) &&
491 Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
494 } else if (Tok.is(tok::kw___finally)) {
498 return StmtError(Diag(Tok, diag::err_seh_expected_handler));
551 if (Tok.isNot(tok::l_brace))
552 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
572 if (Tok.isNot(tok::l_brace))
573 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
605 assert(Tok.is(tok::identifier) && Tok.getIdentifierInfo() &&
612 Token IdentTok = Tok; // Save the whole token.
615 assert(Tok.is(tok::colon) && "Not a label!");
622 if (Tok.is(tok::kw___attribute)) {
633 if (!getLangOpts().CPlusPlus || Tok.is(tok::semi))
647 Diag(Tok, diag::err_expected_after) << "__attribute__" << tok::semi;
675 assert((MissingCase || Tok.is(tok::kw_case)) && "Not a case stmt!");
711 if (Tok.is(tok::code_completion)) {
786 } while (Tok.is(tok::kw_case));
791 if (Tok.isNot(tok::r_brace)) {
823 assert(Tok.is(tok::kw_default) && "Not a default stmt!");
848 if (Tok.isNot(tok::r_brace)) {
896 assert(Tok.is(tok::l_brace) && "Not a compount stmt!");
912 switch (Tok.getKind()) {
972 if (!Tok.is(tok::semi))
975 SourceLocation StartLoc = Tok.getLocation();
978 while (Tok.is(tok::semi) && !Tok.hasLeadingEmptyMacro() &&
979 Tok.getLocation().isValid() && !Tok.getLocation().isMacroID()) {
980 EndLoc = Tok.getLocation();
1024 Tok.getLocation(),
1045 while (Tok.is(tok::kw___label__)) {
1050 if (Tok.isNot(tok::identifier)) {
1051 Diag(Tok, diag::err_expected) << tok::identifier;
1055 IdentifierInfo *II = Tok.getIdentifierInfo();
1066 StmtResult R = Actions.ActOnDeclStmt(Res, LabelLoc, Tok.getLocation());
1077 while (!tryParseMisplacedModuleImport() && Tok.isNot(tok::r_brace) &&
1078 Tok.isNot(tok::eof)) {
1079 if (Tok.is(tok::annot_pragma_unused)) {
1088 if (Tok.isNot(tok::kw___extension__)) {
1096 while (Tok.is(tok::kw___extension__))
1109 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
1135 SourceLocation CloseLoc = Tok.getLocation();
1185 if (Cond.isInvalid() && Tok.isNot(tok::r_paren)) {
1189 if (Tok.isNot(tok::r_paren))
1206 while (Tok.is(tok::r_paren)) {
1207 Diag(Tok, diag::err_extraneous_rparen_in_condition)
1208 << FixItHint::CreateRemoval(Tok.getLocation());
1275 Token Tok = P.getCurToken();
1277 diag::warn_misleading_indentation, Tok.getLocation()) ||
1279 Tok.isOneOf(tok::semi, tok::r_brace) || Tok.isAnnotation() ||
1280 Tok.getLocation().isMacroID() || PrevLoc.isMacroID() ||
1291 unsigned CurColNum = getVisualIndentation(SM, Tok.getLocation());
1296 !Tok.isAtStartOfLine()) &&
1298 SM.getPresumedLineNumber(Tok.getLocation()) &&
1299 (Tok.isNot(tok::identifier) ||
1301 P.Diag(Tok.getLocation(), diag::warn_misleading_indentation) << Kind;
1317 assert(Tok.is(tok::kw_if) && "Not an if stmt!");
1321 if (Tok.is(tok::kw_constexpr)) {
1322 Diag(Tok, getLangOpts().CPlusPlus17 ? diag::warn_cxx14_compat_constexpr_if
1328 if (Tok.isNot(tok::l_paren)) {
1329 Diag(Tok, diag::err_expected_lparen_after) << "if";
1362 bool IsBracedThen = Tok.is(tok::l_brace);
1387 SourceLocation ThenStmtLoc = Tok.getLocation();
1399 if (Tok.isNot(tok::kw_else))
1410 if (Tok.is(tok::kw_else)) {
1412 *TrailingElseLoc = Tok.getLocation();
1415 ElseStmtLoc = Tok.getLocation();
1427 Tok.is(tok::l_brace));
1442 } else if (Tok.is(tok::code_completion)) {
1477 assert(Tok.is(tok::kw_switch) && "Not a switch stmt!");
1480 if (Tok.isNot(tok::l_paren)) {
1481 Diag(Tok, diag::err_expected_lparen_after) << "switch";
1520 if (Tok.is(tok::l_brace)) {
1540 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1562 assert(Tok.is(tok::kw_while) && "Not a while stmt!");
1563 SourceLocation WhileLoc = Tok.getLocation();
1566 if (Tok.isNot(tok::l_paren)) {
1567 Diag(Tok, diag::err_expected_lparen_after) << "while";
1613 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1637 assert(Tok.is(tok::kw_do) && "Not a do stmt!");
1659 ParseScope InnerScope(this, Scope::DeclScope, C99orCXX, Tok.is(tok::l_brace));
1667 if (Tok.isNot(tok::kw_while)) {
1669 Diag(Tok, diag::err_expected_while);
1677 if (Tok.isNot(tok::l_paren)) {
1678 Diag(Tok, diag::err_expected_lparen_after) << "do/while";
1705 assert(Tok.is(tok::identifier));
1715 bool Result = Tok.is(tok::colon);
1746 assert(Tok.is(tok::kw_for) && "Not a for stmt!");
1750 if (Tok.is(tok::kw_co_await))
1753 if (Tok.isNot(tok::l_paren)) {
1754 Diag(Tok, diag::err_expected_lparen_after) << "for";
1795 if (Tok.is(tok::code_completion)) {
1809 if (Tok.is(tok::semi)) { // for (;
1812 SourceLocation SemiLoc = Tok.getLocation();
1813 if (!Tok.hasLeadingEmptyMacro() && !SemiLoc.isMacroID())
1816 } else if (getLangOpts().CPlusPlus && Tok.is(tok::identifier) &&
1819 IdentifierInfo *Name = Tok.getIdentifierInfo();
1824 if (Tok.is(tok::l_brace))
1841 Diag(Tok, diag::ext_c99_variable_decl_in_for_loop);
1842 Diag(Tok, diag::warn_gcc_variable_decl_in_for_loop);
1849 SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
1853 FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation());
1859 } else if (Tok.is(tok::semi)) { // for (int x = 4;
1866 if (Tok.is(tok::code_completion)) {
1873 Diag(Tok, diag::err_expected_semi_for);
1892 getLangOpts().CPlusPlus11 && !ForEach && Tok.is(tok::colon);
1897 if (Tok.is(tok::semi)) {
1902 if (Tok.is(tok::code_completion)) {
1908 } else if (getLangOpts().CPlusPlus11 && Tok.is(tok::colon) && FirstPart.get()) {
1911 Diag(Tok, diag::err_for_range_expected_decl)
1917 Diag(Tok, diag::err_expected_semi_for);
1921 if (Tok.is(tok::semi))
1932 if (Tok.is(tok::semi)) { // for (...;;
1934 } else if (Tok.is(tok::r_paren)) {
1974 if (Tok.isNot(tok::semi)) {
1976 Diag(Tok, diag::err_expected_semi_for);
1982 if (Tok.is(tok::semi)) {
1986 if (Tok.isNot(tok::r_paren)) { // for (...;...;)
2044 Tok.is(tok::l_brace));
2090 assert(Tok.is(tok::kw_goto) && "Not a goto stmt!");
2094 if (Tok.is(tok::identifier)) {
2095 LabelDecl *LD = Actions.LookupOrCreateLabel(Tok.getIdentifierInfo(),
2096 Tok.getLocation());
2097 Res = Actions.ActOnGotoStmt(GotoLoc, Tok.getLocation(), LD);
2099 } else if (Tok.is(tok::star)) {
2101 Diag(Tok, diag::ext_gnu_indirect_goto);
2110 Diag(Tok, diag::err_expected) << tok::identifier;
2146 assert((Tok.is(tok::kw_return) || Tok.is(tok::kw_co_return)) &&
2148 bool IsCoreturn = Tok.is(tok::kw_co_return);
2152 if (Tok.isNot(tok::semi)) {
2154 PreferredType.enterReturn(Actions, Tok.getLocation());
2156 if (Tok.is(tok::code_completion) && !IsCoreturn) {
2158 PreferredType.get(Tok.getLocation()));
2163 if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus) {
2190 SourceLocation StartLoc = Tok.getLocation();
2193 while (Tok.is(tok::annot_pragma_loop_hint)) {
2222 assert(Tok.is(tok::l_brace));
2223 SourceLocation LBraceLoc = Tok.getLocation();
2255 assert(Tok.is(tok::kw_try) && "Expected 'try'");
2262 if (Tok.is(tok::colon))
2273 SourceLocation LBraceLoc = Tok.getLocation();
2297 bool IsTryCatch = Tok.is(tok::kw_try);
2300 if (llvm::any_of(Toks, [](const Token &Tok) {
2301 return Tok.is(tok::code_completion);
2315 while (IsTryCatch && Tok.is(tok::kw_catch)) {
2332 assert(Tok.is(tok::kw_try) && "Expected 'try'");
2355 if (Tok.isNot(tok::l_brace))
2356 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
2367 if ((Tok.is(tok::identifier) &&
2368 Tok.getIdentifierInfo() == getSEHExceptKeyword()) ||
2369 Tok.is(tok::kw___finally)) {
2372 if(Tok.getIdentifierInfo() == getSEHExceptKeyword()) {
2395 if (Tok.isNot(tok::kw_catch))
2396 return StmtError(Diag(Tok, diag::err_expected_catch));
2397 while (Tok.is(tok::kw_catch)) {
2422 assert(Tok.is(tok::kw_catch) && "Expected 'catch'");
2440 if (Tok.isNot(tok::ellipsis)) {
2460 if (Tok.isNot(tok::l_brace))
2461 return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);
2481 if (!Tok.is(tok::l_brace)) {
2482 Diag(Tok, diag::err_expected) << tok::l_brace;
2502 Diag(Tok, diag::err_expected) << tok::l_brace;
2520 while (Tok.isNot(tok::r_brace)) {
2538 if (!(Tok.is(tok::kw_for) || Tok.is(tok::kw_while) || Tok.is(tok::kw_do))) {
2539 Diag(Tok, diag::err_opencl_unroll_hint_on_non_loop);