Lines Matching defs:PP

36   void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
42 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
48 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
54 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
61 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
70 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
76 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
82 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
88 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
94 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
101 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
111 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
114 if (!PP.getTargetInfo().hasStrictFP() && !PP.getLangOpts().ExpStrictFP) {
115 PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored)
120 if (PP.LexOnOffSwitch(OOS))
123 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
131 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
140 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
143 if (PP.LexOnOffSwitch(OOS))
147 PP.getPreprocessorAllocator().Allocate<Token>(1), 1);
155 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
164 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
172 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
175 PP.Diag(UnknownTok, diag::ext_stdc_pragma_ignored);
181 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
191 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
212 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
234 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
244 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
254 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
260 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
266 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
272 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
280 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
289 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
295 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
305 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
312 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
315 if (!PP.getTargetInfo().hasStrictFP() && !PP.getLangOpts().ExpStrictFP) {
316 PP.Diag(FirstToken.getLocation(), diag::warn_pragma_fp_ignored)
322 PP.Lex(Tok);
324 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
328 PP.Lex(Tok); // Consume the l_paren.
330 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_fenv_access);
337 PP.Lex(Tok);
340 PP.Lex(Tok);
342 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_fenv_access);
346 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
350 PP.Lex(Tok); // Consume the r_paren.
353 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
359 PP.getPreprocessorAllocator().Allocate<Token>(1), 1);
366 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
374 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
385 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
394 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
400 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
407 void HandlePragma(Preprocessor &PP, PragmaIntroducer Introducer,
422 PP.AddPragmaHandler(AlignHandler.get());
425 PP.AddPragmaHandler("GCC", GCCVisibilityHandler.get());
428 PP.AddPragmaHandler(OptionsHandler.get());
431 PP.AddPragmaHandler(PackHandler.get());
434 PP.AddPragmaHandler(MSStructHandler.get());
437 PP.AddPragmaHandler(UnusedHandler.get());
440 PP.AddPragmaHandler(WeakHandler.get());
443 PP.AddPragmaHandler(RedefineExtnameHandler.get());
446 PP.AddPragmaHandler("STDC", FPContractHandler.get());
449 PP.AddPragmaHandler("STDC", STDCFenvAccessHandler.get());
452 PP.AddPragmaHandler("STDC", STDCFenvRoundHandler.get());
455 PP.AddPragmaHandler("STDC", STDCCXLIMITHandler.get());
458 PP.AddPragmaHandler("STDC", STDCUnknownHandler.get());
461 PP.AddPragmaHandler("clang", PCSectionHandler.get());
465 PP.AddPragmaHandler("OPENCL", OpenCLExtensionHandler.get());
467 PP.AddPragmaHandler("OPENCL", FPContractHandler.get());
473 PP.AddPragmaHandler(OpenMPHandler.get());
479 PP.AddPragmaHandler(OpenACCHandler.get());
484 PP.AddPragmaHandler(MSCommentHandler.get());
488 PP.AddPragmaHandler(FloatControlHandler.get());
492 PP.AddPragmaHandler(MSDetectMismatchHandler.get());
494 PP.AddPragmaHandler(MSPointersToMembers.get());
496 PP.AddPragmaHandler(MSVtorDisp.get());
498 PP.AddPragmaHandler(MSInitSeg.get());
500 PP.AddPragmaHandler(MSDataSeg.get());
502 PP.AddPragmaHandler(MSBSSSeg.get());
504 PP.AddPragmaHandler(MSConstSeg.get());
506 PP.AddPragmaHandler(MSCodeSeg.get());
508 PP.AddPragmaHandler(MSSection.get());
511 PP.AddPragmaHandler(MSStrictGuardStackCheck.get());
513 PP.AddPragmaHandler(MSFunction.get());
515 PP.AddPragmaHandler(MSAllocText.get());
517 PP.AddPragmaHandler(MSOptimize.get());
519 PP.AddPragmaHandler(MSRuntimeChecks.get());
521 PP.AddPragmaHandler(MSIntrinsic.get());
523 PP.AddPragmaHandler(MSFenvAccess.get());
529 PP.AddPragmaHandler("clang", CUDAForceHostDeviceHandler.get());
533 PP.AddPragmaHandler("clang", OptimizeHandler.get());
536 PP.AddPragmaHandler("clang", LoopHintHandler.get());
539 PP.AddPragmaHandler(UnrollHintHandler.get());
540 PP.AddPragmaHandler("GCC", UnrollHintHandler.get());
543 PP.AddPragmaHandler(NoUnrollHintHandler.get());
544 PP.AddPragmaHandler("GCC", NoUnrollHintHandler.get());
548 PP.AddPragmaHandler(UnrollAndJamHintHandler.get());
552 PP.AddPragmaHandler(NoUnrollAndJamHintHandler.get());
555 PP.AddPragmaHandler("clang", FPHandler.get());
559 PP.AddPragmaHandler("clang", AttributePragmaHandler.get());
562 PP.AddPragmaHandler("clang", MaxTokensHerePragmaHandler.get());
565 PP.AddPragmaHandler("clang", MaxTokensTotalPragmaHandler.get());
569 PP.AddPragmaHandler("clang", RISCVPragmaHandler.get());
575 PP.RemovePragmaHandler(AlignHandler.get());
577 PP.RemovePragmaHandler("GCC", GCCVisibilityHandler.get());
579 PP.RemovePragmaHandler(OptionsHandler.get());
581 PP.RemovePragmaHandler(PackHandler.get());
583 PP.RemovePragmaHandler(MSStructHandler.get());
585 PP.RemovePragmaHandler(UnusedHandler.get());
587 PP.RemovePragmaHandler(WeakHandler.get());
589 PP.RemovePragmaHandler(RedefineExtnameHandler.get());
593 PP.RemovePragmaHandler("OPENCL", OpenCLExtensionHandler.get());
595 PP.RemovePragmaHandler("OPENCL", FPContractHandler.get());
597 PP.RemovePragmaHandler(OpenMPHandler.get());
600 PP.RemovePragmaHandler(OpenACCHandler.get());
605 PP.RemovePragmaHandler(MSCommentHandler.get());
609 PP.RemovePragmaHandler("clang", PCSectionHandler.get());
612 PP.RemovePragmaHandler(FloatControlHandler.get());
615 PP.RemovePragmaHandler(MSDetectMismatchHandler.get());
617 PP.RemovePragmaHandler(MSPointersToMembers.get());
619 PP.RemovePragmaHandler(MSVtorDisp.get());
621 PP.RemovePragmaHandler(MSInitSeg.get());
623 PP.RemovePragmaHandler(MSDataSeg.get());
625 PP.RemovePragmaHandler(MSBSSSeg.get());
627 PP.RemovePragmaHandler(MSConstSeg.get());
629 PP.RemovePragmaHandler(MSCodeSeg.get());
631 PP.RemovePragmaHandler(MSSection.get());
633 PP.RemovePragmaHandler(MSStrictGuardStackCheck.get());
635 PP.RemovePragmaHandler(MSFunction.get());
637 PP.RemovePragmaHandler(MSAllocText.get());
639 PP.RemovePragmaHandler(MSRuntimeChecks.get());
641 PP.RemovePragmaHandler(MSIntrinsic.get());
643 PP.RemovePragmaHandler(MSOptimize.get());
645 PP.RemovePragmaHandler(MSFenvAccess.get());
650 PP.RemovePragmaHandler("clang", CUDAForceHostDeviceHandler.get());
654 PP.RemovePragmaHandler("STDC", FPContractHandler.get());
657 PP.RemovePragmaHandler("STDC", STDCFenvAccessHandler.get());
660 PP.RemovePragmaHandler("STDC", STDCFenvRoundHandler.get());
663 PP.RemovePragmaHandler("STDC", STDCCXLIMITHandler.get());
666 PP.RemovePragmaHandler("STDC", STDCUnknownHandler.get());
669 PP.RemovePragmaHandler("clang", OptimizeHandler.get());
672 PP.RemovePragmaHandler("clang", LoopHintHandler.get());
675 PP.RemovePragmaHandler(UnrollHintHandler.get());
676 PP.RemovePragmaHandler("GCC", UnrollHintHandler.get());
679 PP.RemovePragmaHandler(NoUnrollHintHandler.get());
680 PP.RemovePragmaHandler("GCC", NoUnrollHintHandler.get());
683 PP.RemovePragmaHandler(UnrollAndJamHintHandler.get());
686 PP.RemovePragmaHandler(NoUnrollAndJamHintHandler.get());
689 PP.RemovePragmaHandler("clang", FPHandler.get());
692 PP.RemovePragmaHandler("clang", AttributePragmaHandler.get());
695 PP.RemovePragmaHandler("clang", MaxTokensHerePragmaHandler.get());
698 PP.RemovePragmaHandler("clang", MaxTokensTotalPragmaHandler.get());
702 PP.RemovePragmaHandler("clang", RISCVPragmaHandler.get());
770 PP.Diag(Tok, diag::warn_pragma_debug_missing_argument) << "dump";
773 PP.Diag(Tok, diag::warn_pragma_debug_unexpected_argument);
789 PP.Diag(StartLoc, diag::warn_pragma_debug_dependent_argument)
943 PP.Diag(Tok, diag::err_expected) << tok::l_brace;
989 PP.Diag(NameLoc, diag::warn_pragma_expected_predicate) << 1;
1001 PP.Diag(NameLoc, diag::warn_pragma_unknown_extension) << Ident;
1005 PP.Diag(NameLoc, diag::warn_pragma_extension_is_core) << Ident;
1007 PP.Diag(NameLoc, diag::warn_pragma_unsupported_extension) << Ident;
1034 PP.EnterTokenStream(std::move(TheTokens->first), TheTokens->second, true,
1039 PP.Lex(Tok); // pragma kind
1061 PP.Lex(Tok);
1062 PP.Lex(Tok);
1069 PP.Diag(PragmaLocation, diag::warn_pragma_expected_lparen) << PragmaName;
1072 PP.Lex(Tok); // (
1075 PP.Diag(PragmaLocation, diag::warn_pragma_expected_section_name)
1084 PP.Diag(PragmaLocation, diag::warn_pragma_expected_non_wide_string)
1091 PP.Lex(Tok); // ,
1096 PP.Lex(Tok); // long/short
1101 PP.Diag(PragmaLocation, diag::warn_pragma_expected_action_or_r_paren)
1118 PP.Diag(PragmaLocation, Flag == ASTContext::PSF_None
1126 PP.Lex(Tok); // Identifier
1133 PP.Diag(PragmaLocation, diag::warn_pragma_expected_rparen) << PragmaName;
1136 PP.Lex(Tok); // )
1138 PP.Diag(PragmaLocation, diag::warn_pragma_extra_tokens_at_eol)
1142 PP.Lex(Tok); // eof
1150 PP.Diag(PragmaLocation, diag::warn_pragma_expected_lparen) << PragmaName;
1153 PP.Lex(Tok); // (
1163 PP.Diag(PragmaLocation,
1169 PP.Lex(Tok); // push | pop
1171 PP.Lex(Tok); // ,
1175 PP.Lex(Tok); // identifier
1177 PP.Lex(Tok);
1179 PP.Diag(PragmaLocation, diag::warn_pragma_expected_punc)
1185 PP.Diag(PragmaLocation, diag::warn_pragma_expected_punc) << PragmaName;
1198 PP.Diag(PragmaLocation, DiagID) << PragmaName;
1206 PP.Diag(PragmaLocation, diag::warn_pragma_expected_non_wide_string)
1215 PP.Diag(PragmaLocation, diag::warn_pragma_expected_rparen) << PragmaName;
1218 PP.Lex(Tok); // )
1220 PP.Diag(PragmaLocation, diag::warn_pragma_extra_tokens_at_eol)
1224 PP.Lex(Tok); // eof
1234 PP.Diag(PragmaLocation, diag::warn_pragma_init_seg_unsupported_target);
1262 PP.Lex(Tok);
1270 PP.Diag(PragmaLocation, diag::warn_pragma_expected_non_wide_string)
1278 PP.Diag(PragmaLocation, diag::warn_pragma_expected_init_seg) << PragmaName;
1305 PP.Lex(Tok);
1311 PP.Lex(Tok);
1320 PP.Lex(Tok);
1323 PP.Lex(Tok);
1326 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action)
1359 PP.Diag(PragmaLocation, diag::warn_pragma_expected_non_wide_string)
1366 PP.Lex(Tok);
1368 PP.Diag(PragmaLocation, diag::warn_pragma_expected_section_name)
1380 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1388 PP.Lex(Tok);
1391 PP.Lex(Tok);
1513 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/false,
1523 PP.Lex(Tok); // Identifier
1546 PP.Lex(Tok); // ,
1559 PP.Lex(Tok); // Identifier
1583 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/false,
1900 PP.EnterTokenStream(Info->Tokens, /*DisableMacroExpansion=*/false,
2068 void PragmaGCCVisibilityHandler::HandlePragma(Preprocessor &PP,
2074 PP.LexUnexpandedToken(Tok);
2082 PP.LexUnexpandedToken(Tok);
2084 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
2088 PP.LexUnexpandedToken(Tok);
2091 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2095 PP.LexUnexpandedToken(Tok);
2097 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
2102 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2107 PP.LexUnexpandedToken(Tok);
2109 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2121 PP.EnterTokenStream(std::move(Toks), 1, /*DisableMacroExpansion=*/true,
2129 void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2135 PP.Lex(Tok);
2137 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "pack";
2145 PP.Lex(Tok);
2149 PP.Lex(Tok);
2154 Action = (PP.getLangOpts().ApplePragmaPack || PP.getLangOpts().XLPragmaPack)
2161 PP.Lex(Tok);
2168 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action) << "pack";
2171 PP.Lex(Tok);
2174 PP.Lex(Tok);
2180 PP.Lex(Tok);
2183 PP.Lex(Tok);
2186 PP.Lex(Tok);
2189 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
2196 PP.Lex(Tok);
2199 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
2204 } else if (PP.getLangOpts().ApplePragmaPack ||
2205 PP.getLangOpts().XLPragmaPack) {
2214 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen) << "pack";
2219 PP.Lex(Tok);
2221 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "pack";
2226 PP.getPreprocessorAllocator().Allocate<Sema::PragmaPackInfo>(1);
2231 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
2238 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2244 void PragmaMSStructHandler::HandlePragma(Preprocessor &PP,
2250 PP.Lex(Tok);
2252 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
2259 PP.Lex(Tok);
2262 PP.Lex(Tok);
2264 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
2269 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2274 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
2282 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2287 void PragmaClangSectionHandler::HandlePragma(Preprocessor &PP,
2294 PP.Lex(Tok); // eat 'section'
2297 PP.Diag(Tok.getLocation(), diag::err_pragma_expected_clang_section_name) << "clang section";
2313 PP.Diag(Tok.getLocation(), diag::err_pragma_expected_clang_section_name) << "clang section";
2318 PP.Lex(Tok); // eat ['bss'|'data'|'rodata'|'text']
2320 PP.Diag(Tok.getLocation(), diag::err_pragma_clang_section_expected_equal) << SecKind;
2325 if (!PP.LexStringLiteral(Tok, SecName, "pragma clang section", false))
2339 static void ParseAlignPragma(Preprocessor &PP, Token &FirstTok,
2344 PP.Lex(Tok);
2347 PP.Diag(Tok.getLocation(), diag::warn_pragma_options_expected_align);
2352 PP.Lex(Tok);
2353 if (PP.getLangOpts().XLPragmaPack) {
2355 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "align";
2359 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_expected_equal)
2364 PP.Lex(Tok);
2366 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2386 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_invalid_option)
2391 if (PP.getLangOpts().XLPragmaPack) {
2392 PP.Lex(Tok);
2394 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen) << "align";
2400 PP.Lex(Tok);
2402 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2407 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
2415 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2419 void PragmaAlignHandler::HandlePragma(Preprocessor &PP,
2422 ParseAlignPragma(PP, AlignTok, /*IsOptions=*/false);
2425 void PragmaOptionsHandler::HandlePragma(Preprocessor &PP,
2428 ParseAlignPragma(PP, OptionsTok, /*IsOptions=*/true);
2432 void PragmaUnusedHandler::HandlePragma(Preprocessor &PP,
2440 PP.Lex(Tok);
2442 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "unused";
2452 PP.Lex(Tok);
2462 PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_var);
2478 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_punc) << "unused";
2482 PP.Lex(Tok);
2484 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
2499 PP.getPreprocessorAllocator().Allocate<Token>(2 * Identifiers.size()),
2508 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2514 void PragmaWeakHandler::HandlePragma(Preprocessor &PP,
2520 PP.Lex(Tok);
2522 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) << "weak";
2530 PP.Lex(Tok);
2533 PP.Lex(Tok);
2535 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2540 PP.Lex(Tok);
2544 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "weak";
2550 PP.getPreprocessorAllocator().Allocate<Token>(3), 3);
2558 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2562 PP.getPreprocessorAllocator().Allocate<Token>(2), 2);
2569 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2575 void PragmaRedefineExtnameHandler::HandlePragma(Preprocessor &PP,
2581 PP.Lex(Tok);
2583 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
2589 PP.Lex(Tok);
2592 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2598 PP.Lex(Tok);
2601 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
2606 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(3),
2615 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2619 void PragmaFPContractHandler::HandlePragma(Preprocessor &PP,
2623 if (PP.LexOnOffSwitch(OOS))
2626 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
2634 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2638 void PragmaOpenCLExtensionHandler::HandlePragma(Preprocessor &PP,
2641 PP.LexUnexpandedToken(Tok);
2643 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
2650 PP.Lex(Tok);
2652 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_colon) << Ext;
2656 PP.Lex(Tok);
2658 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_predicate) << 0;
2673 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_predicate)
2679 PP.Lex(Tok);
2681 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
2686 auto Info = PP.getPreprocessorAllocator().Allocate<OpenCLExtData>(1);
2689 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
2696 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
2699 if (PP.getPPCallbacks())
2700 PP.getPPCallbacks()->PragmaOpenCLExtension(NameLoc, Ext,
2708 Preprocessor &PP, PragmaIntroducer Introducer, Token &FirstTok) {
2709 if (!PP.getDiagnostics().isIgnored(IgnoredDiag, FirstTok.getLocation())) {
2710 PP.Diag(FirstTok, IgnoredDiag);
2711 PP.getDiagnostics().setSeverity(IgnoredDiag, diag::Severity::Ignored,
2714 PP.DiscardUntilEndOfDirective();
2722 Preprocessor &PP, PragmaIntroducer Introducer, Token &FirstTok) {
2731 PP.Lex(Tok);
2733 PP.Diag(Tok, UnexpectedDiag) << 0;
2736 PP.Lex(Tok);
2742 PP.Lex(Tok);
2753 PP.EnterTokenStream(std::move(Toks), Pragma.size(),
2765 void PragmaMSPointersToMembers::HandlePragma(Preprocessor &PP,
2769 PP.Lex(Tok);
2771 PP.Diag(PointersToMembersLoc, diag::warn_pragma_expected_lparen)
2775 PP.Lex(Tok);
2778 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
2782 PP.Lex(Tok);
2790 PP.Lex(Tok);
2794 PP.Diag(Tok.getLocation(),
2799 PP.Lex(Tok);
2806 PP.Diag(Tok.getLocation(), diag::err_expected_punc)
2823 PP.Diag(Tok.getLocation(),
2832 PP.Diag(Tok.getLocation(), diag::err_expected_rparen_after)
2838 PP.Lex(Tok);
2840 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2852 PP.EnterToken(AnnotTok, /*IsReinject=*/true);
2863 void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
2866 PP.Lex(Tok);
2868 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_lparen) << "vtordisp";
2871 PP.Lex(Tok);
2878 PP.Lex(Tok);
2880 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_punc) << "vtordisp";
2883 PP.Lex(Tok);
2888 PP.Lex(Tok);
2904 PP.Lex(Tok);
2907 PP.Lex(Tok);
2910 PP.parseSimpleIntegerLiteral(Tok, Value)) {
2912 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_integer)
2917 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action)
2925 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_rparen) << "vtordisp";
2929 PP.Lex(Tok);
2931 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2944 PP.EnterToken(AnnotTok, /*IsReinject=*/false);
2949 void PragmaMSPragma::HandlePragma(Preprocessor &PP,
2960 for (; Tok.isNot(tok::eod); PP.Lex(Tok)) {
2971 auto Value = new (PP.getPreprocessorAllocator())
2975 PP.EnterToken(AnnotTok, /*IsReinject*/ false);
2989 void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
2995 if (!PP.getTargetInfo().hasStrictFP() && !PP.getLangOpts().ExpStrictFP) {
2996 PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored)
3000 PP.Lex(Tok);
3002 PP.Diag(FloatControlLoc, diag::err_expected) << tok::l_paren;
3007 PP.Lex(Tok);
3009 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3022 PP.Lex(Tok); // the identifier
3024 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3028 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3031 PP.Lex(Tok); // Eat the r_paren
3036 PP.Lex(Tok); // the r_paren
3038 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3041 PP.Lex(Tok); // ,
3043 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3058 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3061 PP.Lex(Tok); // the identifier
3063 PP.Lex(Tok); // ,
3065 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3072 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3075 PP.Lex(Tok); // the push identifier
3078 PP.Diag(Tok.getLocation(), diag::err_pragma_float_control_malformed);
3081 PP.Lex(Tok); // the r_paren
3086 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3091 // Note: there is no accomodation for PP callback for this pragma.
3103 PP.EnterTokenStream(std::move(TokenArray), 1,
3117 void PragmaDetectMismatchHandler::HandlePragma(Preprocessor &PP,
3121 PP.Lex(Tok);
3123 PP.Diag(DetectMismatchLoc, diag::err_expected) << tok::l_paren;
3129 if (!PP.LexStringLiteral(Tok, NameString,
3137 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
3141 if (!PP.LexStringLiteral(Tok, ValueString, "pragma detect_mismatch",
3146 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
3149 PP.Lex(Tok); // Eat the r_paren.
3152 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
3157 if (PP.getPPCallbacks())
3158 PP.getPPCallbacks()->PragmaDetectMismatch(DetectMismatchLoc, NameString,
3173 void PragmaCommentHandler::HandlePragma(Preprocessor &PP,
3177 PP.Lex(Tok);
3179 PP.Diag(CommentLoc, diag::err_pragma_comment_malformed);
3184 PP.Lex(Tok);
3186 PP.Diag(CommentLoc, diag::err_pragma_comment_malformed);
3201 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_unknown_kind);
3205 if (PP.getTargetInfo().getTriple().isOSBinFormatELF() && Kind != PCK_Lib) {
3206 PP.Diag(Tok.getLocation(), diag::warn_pragma_comment_ignored)
3212 PP.Lex(Tok);
3214 if (Tok.is(tok::comma) && !PP.LexStringLiteral(Tok, ArgumentString,
3227 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
3230 PP.Lex(Tok); // eat the r_paren.
3233 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
3238 if (PP.getPPCallbacks())
3239 PP.getPPCallbacks()->PragmaComment(CommentLoc, II, ArgumentString);
3246 void PragmaOptimizeHandler::HandlePragma(Preprocessor &PP,
3250 PP.Lex(Tok);
3252 PP.Diag(Tok.getLocation(), diag::err_pragma_missing_argument)
3257 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
3258 << PP.getSpelling(Tok);
3267 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
3268 << PP.getSpelling(Tok);
3271 PP.Lex(Tok);
3274 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_extra_argument)
3275 << PP.getSpelling(Tok);
3295 void PragmaFPHandler::HandlePragma(Preprocessor &PP,
3301 PP.Lex(Tok);
3303 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_option)
3308 auto *AnnotValue = new (PP.getPreprocessorAllocator()) TokFPAnnotValue;
3321 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_option)
3325 PP.Lex(Tok);
3329 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
3332 PP.Lex(Tok);
3338 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_argument)
3339 << PP.getSpelling(Tok) << OptionInfo->getName()
3354 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_argument)
3355 << PP.getSpelling(Tok) << OptionInfo->getName() << *FlagKind;
3367 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_argument)
3368 << PP.getSpelling(Tok) << OptionInfo->getName() << *FlagKind;
3380 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_argument)
3381 << PP.getSpelling(Tok) << OptionInfo->getName() << *FlagKind;
3393 PP.Diag(Tok.getLocation(), diag::err_pragma_fp_invalid_argument)
3394 << PP.getSpelling(Tok) << OptionInfo->getName() << *FlagKind;
3398 PP.Lex(Tok);
3402 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
3405 PP.Lex(Tok);
3409 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3425 PP.EnterTokenStream(std::move(TokenArray), TokenList.size(),
3429 void PragmaSTDC_FENV_ROUNDHandler::HandlePragma(Preprocessor &PP,
3434 if (!PP.getTargetInfo().hasStrictFP() && !PP.getLangOpts().ExpStrictFP) {
3435 PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored)
3440 PP.Lex(Tok);
3442 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
3458 PP.Diag(Tok.getLocation(), diag::warn_stdc_unknown_rounding_mode);
3461 PP.Lex(Tok);
3464 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3470 PP.Diag(Tok.getLocation(), diag::warn_stdc_fenv_round_not_supported);
3472 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1),
3480 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true,
3512 static bool ParseLoopHintValue(Preprocessor &PP, Token &Tok, Token PragmaName,
3528 PP.Lex(Tok);
3534 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
3537 PP.Lex(Tok);
3547 Info.Toks = llvm::ArrayRef(ValueList).copy(PP.getPreprocessorAllocator());
3602 void PragmaLoopHintHandler::HandlePragma(Preprocessor &PP,
3610 PP.Lex(Tok);
3612 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
3634 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
3638 PP.Lex(Tok);
3642 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
3645 PP.Lex(Tok);
3647 auto *Info = new (PP.getPreprocessorAllocator()) PragmaLoopHintInfo;
3648 if (ParseLoopHintValue(PP, Tok, PragmaName, Option, /*ValueInParens=*/true,
3663 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3671 PP.EnterTokenStream(std::move(TokenArray), TokenList.size(),
3696 void PragmaUnrollHintHandler::HandlePragma(Preprocessor &PP,
3702 PP.Lex(Tok);
3703 auto *Info = new (PP.getPreprocessorAllocator()) PragmaLoopHintInfo;
3710 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3719 PP.Lex(Tok);
3723 if (ParseLoopHintValue(PP, Tok, PragmaName, Option, ValueInParens, *Info))
3728 if (PP.getLangOpts().CUDA && ValueInParens)
3729 PP.Diag(Info->Toks[0].getLocation(),
3733 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3746 PP.EnterTokenStream(std::move(TokenArray), 1,
3762 void PragmaMSIntrinsicHandler::HandlePragma(Preprocessor &PP,
3765 PP.Lex(Tok);
3768 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
3772 PP.Lex(Tok);
3774 bool SuggestIntrinH = !PP.isMacroDefined("__INTRIN_H");
3779 PP.Diag(Tok.getLocation(), diag::warn_pragma_intrinsic_builtin)
3782 PP.Lex(Tok);
3785 PP.Lex(Tok);
3789 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
3793 PP.Lex(Tok);
3796 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
3808 bool SuggestIntrinH = !PP.isMacroDefined("__INTRIN_H");
3814 PP.Diag(Tok.getLocation(), diag::warn_pragma_intrinsic_builtin)
3819 PP.Lex(Tok);
3822 PP.Lex(Tok); // ,
3844 PP.Diag(PragmaLocation, diag::warn_pragma_expected_string) << PragmaName;
3852 PP.Diag(PragmaLocation, diag::warn_pragma_expected_non_wide_string)
3862 PP.Diag(PragmaLocation, diag::warn_pragma_missing_argument)
3868 PP.Diag(PragmaLocation, diag::warn_pragma_invalid_argument)
3869 << PP.getSpelling(Tok) << PragmaName << /*Expected=*/true
3874 PP.Lex(Tok);
3882 PP.Diag(PragmaLocation, diag::warn_pragma_invalid_argument)
3897 Preprocessor &PP, PragmaIntroducer Introducer, Token &Tok) {
3900 PP.Lex(Tok);
3903 PP.Diag(FirstTok.getLocation(),
3911 PP.Diag(FirstTok.getLocation(),
3914 PP.Lex(Tok);
3916 PP.Diag(FirstTok.getLocation(),
3947 void PragmaAttributeHandler::HandlePragma(Preprocessor &PP,
3951 PP.Lex(Tok);
3952 auto *Info = new (PP.getPreprocessorAllocator())
3960 PP.Lex(Tok);
3963 PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_expected_period)
3967 PP.Lex(Tok);
3972 PP.Diag(Tok.getLocation(),
3980 PP.Diag(Tok.getLocation(),
3982 PP.Diag(Tok.getLocation(),
3994 PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_invalid_argument)
3995 << PP.getSpelling(Tok);
3999 PP.Lex(Tok);
4006 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
4009 PP.Lex(Tok);
4024 PP.Lex(Tok);
4028 PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_expected_attribute);
4032 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
4036 PP.Lex(Tok);
4047 llvm::ArrayRef(AttributeTokens).copy(PP.getPreprocessorAllocator());
4051 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
4061 PP.EnterTokenStream(std::move(TokenArray), 1,
4066 void PragmaMaxTokensHereHandler::HandlePragma(Preprocessor &PP,
4069 PP.Lex(Tok);
4071 PP.Diag(Tok.getLocation(), diag::err_pragma_missing_argument)
4079 !PP.parseSimpleIntegerLiteral(Tok, MaxTokens)) {
4080 PP.Diag(Tok.getLocation(), diag::err_pragma_expected_integer)
4086 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
4091 if (PP.getTokenCount() > MaxTokens) {
4092 PP.Diag(Loc, diag::warn_max_tokens)
4093 << PP.getTokenCount() << (unsigned)MaxTokens;
4098 void PragmaMaxTokensTotalHandler::HandlePragma(Preprocessor &PP,
4101 PP.Lex(Tok);
4103 PP.Diag(Tok.getLocation(), diag::err_pragma_missing_argument)
4111 !PP.parseSimpleIntegerLiteral(Tok, MaxTokens)) {
4112 PP.Diag(Tok.getLocation(), diag::err_pragma_expected_integer)
4118 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
4123 PP.overrideMaxTokens(MaxTokens, Loc);
4128 void PragmaRISCVHandler::HandlePragma(Preprocessor &PP,
4132 PP.Lex(Tok);
4136 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_argument)
4137 << PP.getSpelling(Tok) << "riscv" << /*Expected=*/true << "'intrinsic'";
4141 PP.Lex(Tok);
4144 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_argument)
4145 << PP.getSpelling(Tok) << "riscv" << /*Expected=*/true
4150 PP.Lex(Tok);
4152 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)