Lines Matching refs:PP
27 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
33 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
39 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
45 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
51 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
57 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
63 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
69 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
75 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
82 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
88 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
94 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
102 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
111 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
119 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
125 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
131 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
139 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
147 void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
155 PP.AddPragmaHandler(AlignHandler.get());
158 PP.AddPragmaHandler("GCC", GCCVisibilityHandler.get());
161 PP.AddPragmaHandler(OptionsHandler.get());
164 PP.AddPragmaHandler(PackHandler.get());
167 PP.AddPragmaHandler(MSStructHandler.get());
170 PP.AddPragmaHandler(UnusedHandler.get());
173 PP.AddPragmaHandler(WeakHandler.get());
176 PP.AddPragmaHandler(RedefineExtnameHandler.get());
179 PP.AddPragmaHandler("STDC", FPContractHandler.get());
183 PP.AddPragmaHandler("OPENCL", OpenCLExtensionHandler.get());
185 PP.AddPragmaHandler("OPENCL", FPContractHandler.get());
191 PP.AddPragmaHandler(OpenMPHandler.get());
195 PP.AddPragmaHandler(MSCommentHandler.get());
197 PP.AddPragmaHandler(MSDetectMismatchHandler.get());
199 PP.AddPragmaHandler(MSPointersToMembers.get());
201 PP.AddPragmaHandler(MSVtorDisp.get());
203 PP.AddPragmaHandler(MSInitSeg.get());
205 PP.AddPragmaHandler(MSDataSeg.get());
207 PP.AddPragmaHandler(MSBSSSeg.get());
209 PP.AddPragmaHandler(MSConstSeg.get());
211 PP.AddPragmaHandler(MSCodeSeg.get());
213 PP.AddPragmaHandler(MSSection.get());
217 PP.AddPragmaHandler("clang", OptimizeHandler.get());
220 PP.AddPragmaHandler("clang", LoopHintHandler.get());
225 PP.RemovePragmaHandler(AlignHandler.get());
227 PP.RemovePragmaHandler("GCC", GCCVisibilityHandler.get());
229 PP.RemovePragmaHandler(OptionsHandler.get());
231 PP.RemovePragmaHandler(PackHandler.get());
233 PP.RemovePragmaHandler(MSStructHandler.get());
235 PP.RemovePragmaHandler(UnusedHandler.get());
237 PP.RemovePragmaHandler(WeakHandler.get());
239 PP.RemovePragmaHandler(RedefineExtnameHandler.get());
243 PP.RemovePragmaHandler("OPENCL", OpenCLExtensionHandler.get());
245 PP.RemovePragmaHandler("OPENCL", FPContractHandler.get());
247 PP.RemovePragmaHandler(OpenMPHandler.get());
251 PP.RemovePragmaHandler(MSCommentHandler.get());
253 PP.RemovePragmaHandler(MSDetectMismatchHandler.get());
255 PP.RemovePragmaHandler(MSPointersToMembers.get());
257 PP.RemovePragmaHandler(MSVtorDisp.get());
259 PP.RemovePragmaHandler(MSInitSeg.get());
261 PP.RemovePragmaHandler(MSDataSeg.get());
263 PP.RemovePragmaHandler(MSBSSSeg.get());
265 PP.RemovePragmaHandler(MSConstSeg.get());
267 PP.RemovePragmaHandler(MSCodeSeg.get());
269 PP.RemovePragmaHandler(MSSection.get());
273 PP.RemovePragmaHandler("STDC", FPContractHandler.get());
276 PP.RemovePragmaHandler("clang", OptimizeHandler.get());
279 PP.RemovePragmaHandler("clang", LoopHintHandler.get());
394 PP.Diag(Tok, diag::err_expected) << tok::l_brace;
439 PP.Diag(NameLoc, diag::warn_pragma_unknown_extension) << ename;
467 PP.EnterTokenStream(TheTokens->first, TheTokens->second, true, true);
471 PP.Lex(Tok); // pragma kind
483 PP.Diag(PragmaLocation, DiagID) << PragmaName;
485 PP.Lex(Tok);
486 PP.Lex(Tok);
494 PP.Lex(Tok); // (
502 PP.Lex(Tok); // ,
518 PP.Diag(PragmaLocation, Flag == Sema::PSF_None ?
523 PP.Lex(Tok);
524 PP.Lex(Tok);
528 PP.Lex(Tok); // Identifier
532 PP.Lex(Tok); // )
535 PP.Lex(Tok); // eof
544 PP.Lex(Tok); // (
556 PP.Lex(Tok); // push | pop
558 PP.Lex(Tok); // ,
562 PP.Lex(Tok); // identifier
564 PP.Lex(Tok);
587 PP.Lex(Tok); // )
590 PP.Lex(Tok); // eof
598 return PP.getDiagnostics().getCustomDiagID(
639 void PragmaGCCVisibilityHandler::HandlePragma(Preprocessor &PP,
645 PP.LexUnexpandedToken(Tok);
653 PP.LexUnexpandedToken(Tok);
655 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
659 PP.LexUnexpandedToken(Tok);
662 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
666 PP.LexUnexpandedToken(Tok);
668 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
673 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
677 PP.LexUnexpandedToken(Tok);
679 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
690 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
698 void PragmaPackHandler::HandlePragma(Preprocessor &PP,
704 PP.Lex(Tok);
706 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "pack";
715 PP.Lex(Tok);
719 PP.Lex(Tok);
724 if (PP.getLangOpts().ApplePragmaPack)
730 PP.Lex(Tok);
737 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action) << "pack";
740 PP.Lex(Tok);
743 PP.Lex(Tok);
748 PP.Lex(Tok);
751 PP.Lex(Tok);
754 PP.Lex(Tok);
757 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
763 PP.Lex(Tok);
766 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
771 } else if (PP.getLangOpts().ApplePragmaPack) {
779 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen) << "pack";
784 PP.Lex(Tok);
786 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "pack";
791 (PragmaPackInfo*) PP.getPreprocessorAllocator().Allocate(
801 (Token*) PP.getPreprocessorAllocator().Allocate(
808 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
814 void PragmaMSStructHandler::HandlePragma(Preprocessor &PP,
820 PP.Lex(Tok);
822 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
828 PP.Lex(Tok);
831 PP.Lex(Tok);
833 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
838 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
844 (Token*) PP.getPreprocessorAllocator().Allocate(
852 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
858 static void ParseAlignPragma(Preprocessor &PP, Token &FirstTok,
863 PP.Lex(Tok);
866 PP.Diag(Tok.getLocation(), diag::warn_pragma_options_expected_align);
871 PP.Lex(Tok);
873 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_expected_equal)
878 PP.Lex(Tok);
880 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
900 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_invalid_option)
905 PP.Lex(Tok);
907 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
913 (Token*) PP.getPreprocessorAllocator().Allocate(
921 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
925 void PragmaAlignHandler::HandlePragma(Preprocessor &PP,
928 ParseAlignPragma(PP, AlignTok, /*IsOptions=*/false);
931 void PragmaOptionsHandler::HandlePragma(Preprocessor &PP,
934 ParseAlignPragma(PP, OptionsTok, /*IsOptions=*/true);
938 void PragmaUnusedHandler::HandlePragma(Preprocessor &PP,
946 PP.Lex(Tok);
948 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "unused";
958 PP.Lex(Tok);
968 PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_var);
984 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_punc) << "unused";
988 PP.Lex(Tok);
990 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1005 (Token*) PP.getPreprocessorAllocator().Allocate(
1014 PP.EnterTokenStream(Toks, 2*Identifiers.size(),
1020 void PragmaWeakHandler::HandlePragma(Preprocessor &PP,
1026 PP.Lex(Tok);
1028 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) << "weak";
1036 PP.Lex(Tok);
1039 PP.Lex(Tok);
1041 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1046 PP.Lex(Tok);
1050 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "weak";
1056 (Token*) PP.getPreprocessorAllocator().Allocate(
1064 PP.EnterTokenStream(Toks, 3,
1068 (Token*) PP.getPreprocessorAllocator().Allocate(
1075 PP.EnterTokenStream(Toks, 2,
1081 void PragmaRedefineExtnameHandler::HandlePragma(Preprocessor &PP,
1087 PP.Lex(Tok);
1089 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
1095 PP.Lex(Tok);
1098 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1104 PP.Lex(Tok);
1107 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1113 (Token*) PP.getPreprocessorAllocator().Allocate(
1121 PP.EnterTokenStream(Toks, 3,
1127 PragmaFPContractHandler::HandlePragma(Preprocessor &PP,
1131 if (PP.LexOnOffSwitch(OOS))
1135 (Token*) PP.getPreprocessorAllocator().Allocate(
1143 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
1148 PragmaOpenCLExtensionHandler::HandlePragma(Preprocessor &PP,
1151 PP.LexUnexpandedToken(Tok);
1153 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
1160 PP.Lex(Tok);
1162 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_colon) << ename;
1166 PP.Lex(Tok);
1168 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_enable_disable);
1179 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_enable_disable);
1184 PP.Lex(Tok);
1186 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1193 (Token*) PP.getPreprocessorAllocator().Allocate(
1200 PP.EnterTokenStream(Toks, 1, /*DisableMacroExpansion=*/true,
1203 if (PP.getPPCallbacks())
1204 PP.getPPCallbacks()->PragmaOpenCLExtension(NameLoc, ename,
1211 PragmaNoOpenMPHandler::HandlePragma(Preprocessor &PP,
1214 if (!PP.getDiagnostics().isIgnored(diag::warn_pragma_omp_ignored,
1216 PP.Diag(FirstTok, diag::warn_pragma_omp_ignored);
1217 PP.getDiagnostics().setSeverity(diag::warn_pragma_omp_ignored,
1220 PP.DiscardUntilEndOfDirective();
1226 PragmaOpenMPHandler::HandlePragma(Preprocessor &PP,
1237 PP.Lex(Tok);
1247 PP.EnterTokenStream(Toks, Pragma.size(),
1259 void PragmaMSPointersToMembers::HandlePragma(Preprocessor &PP,
1263 PP.Lex(Tok);
1265 PP.Diag(PointersToMembersLoc, diag::warn_pragma_expected_lparen)
1269 PP.Lex(Tok);
1272 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1276 PP.Lex(Tok);
1284 PP.Lex(Tok);
1288 PP.Diag(Tok.getLocation(),
1293 PP.Lex(Tok);
1300 PP.Diag(Tok.getLocation(), diag::err_expected_punc)
1317 PP.Diag(Tok.getLocation(),
1326 PP.Diag(Tok.getLocation(), diag::err_expected_rparen_after)
1331 PP.Lex(Tok);
1333 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1344 PP.EnterToken(AnnotTok);
1355 void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
1359 PP.Lex(Tok);
1361 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_lparen) << "vtordisp";
1364 PP.Lex(Tok);
1371 PP.Lex(Tok);
1373 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_punc) << "vtordisp";
1376 PP.Lex(Tok);
1381 PP.Lex(Tok);
1397 PP.Lex(Tok);
1400 PP.Lex(Tok);
1403 PP.parseSimpleIntegerLiteral(Tok, Value)) {
1405 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_integer)
1410 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action)
1418 PP.Diag(VtorDispLoc, diag::warn_pragma_expected_rparen) << "vtordisp";
1421 PP.Lex(Tok);
1423 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1435 PP.EnterToken(AnnotTok);
1440 void PragmaMSPragma::HandlePragma(Preprocessor &PP,
1451 for (; Tok.isNot(tok::eod); PP.Lex(Tok))
1459 auto Value = new (PP.getPreprocessorAllocator())
1462 PP.EnterToken(AnnotTok);
1475 void PragmaDetectMismatchHandler::HandlePragma(Preprocessor &PP,
1479 PP.Lex(Tok);
1481 PP.Diag(CommentLoc, diag::err_expected) << tok::l_paren;
1487 if (!PP.LexStringLiteral(Tok, NameString,
1495 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
1499 if (!PP.LexStringLiteral(Tok, ValueString, "pragma detect_mismatch",
1504 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
1507 PP.Lex(Tok); // Eat the r_paren.
1510 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
1515 if (PP.getPPCallbacks())
1516 PP.getPPCallbacks()->PragmaDetectMismatch(CommentLoc, NameString,
1531 void PragmaCommentHandler::HandlePragma(Preprocessor &PP,
1535 PP.Lex(Tok);
1537 PP.Diag(CommentLoc, diag::err_pragma_comment_malformed);
1542 PP.Lex(Tok);
1544 PP.Diag(CommentLoc, diag::err_pragma_comment_malformed);
1559 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_unknown_kind);
1564 PP.Lex(Tok);
1566 if (Tok.is(tok::comma) && !PP.LexStringLiteral(Tok, ArgumentString,
1579 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
1582 PP.Lex(Tok); // eat the r_paren.
1585 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
1590 if (PP.getPPCallbacks())
1591 PP.getPPCallbacks()->PragmaComment(CommentLoc, II, ArgumentString);
1598 void PragmaOptimizeHandler::HandlePragma(Preprocessor &PP,
1602 PP.Lex(Tok);
1604 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_missing_argument);
1608 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
1609 << PP.getSpelling(Tok);
1618 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
1619 << PP.getSpelling(Tok);
1622 PP.Lex(Tok);
1625 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_extra_argument)
1626 << PP.getSpelling(Tok);
1671 void PragmaLoopHintHandler::HandlePragma(Preprocessor &PP,
1678 PP.Lex(Tok);
1680 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
1698 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
1704 PP.Lex(Tok);
1706 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
1712 PP.Lex(Tok);
1715 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_missing_argument)
1722 PP.Lex(Tok);
1724 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
1729 PP.Lex(Tok);
1731 auto *Info = new (PP.getPreprocessorAllocator()) PragmaLoopHintInfo;
1746 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1754 PP.EnterTokenStream(TokenArray, TokenList.size(),