Lines Matching refs:Tok
323 assert(Tok.is(tok::annot_pragma_unused));
325 Actions.ActOnPragmaUnused(Tok, getCurScope(), UnusedLoc);
330 assert(Tok.is(tok::annot_pragma_vis));
332 static_cast<IdentifierInfo *>(Tok.getAnnotationValue());
348 assert(Tok.is(tok::annot_pragma_pack));
350 static_cast<PragmaPackInfo *>(Tok.getAnnotationValue());
353 if (Info->Alignment.is(tok::numeric_constant)) {
363 assert(Tok.is(tok::annot_pragma_msstruct));
366 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
372 assert(Tok.is(tok::annot_pragma_align));
375 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
381 assert(Tok.is(tok::annot_pragma_weak));
383 Actions.ActOnPragmaWeakID(Tok.getIdentifierInfo(), PragmaLoc,
384 Tok.getLocation());
389 assert(Tok.is(tok::annot_pragma_weakalias));
391 IdentifierInfo *WeakName = Tok.getIdentifierInfo();
392 SourceLocation WeakNameLoc = Tok.getLocation();
394 IdentifierInfo *AliasName = Tok.getIdentifierInfo();
395 SourceLocation AliasNameLoc = Tok.getLocation();
403 assert(Tok.is(tok::annot_pragma_redefine_extname));
405 IdentifierInfo *RedefName = Tok.getIdentifierInfo();
406 SourceLocation RedefNameLoc = Tok.getLocation();
408 IdentifierInfo *AliasName = Tok.getIdentifierInfo();
409 SourceLocation AliasNameLoc = Tok.getLocation();
416 assert(Tok.is(tok::annot_pragma_fp_contract));
417 tok::OnOffSwitch OOS =
418 static_cast<tok::OnOffSwitch>(
419 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
426 assert(Tok.is(tok::annot_pragma_captured));
429 if (Tok.isNot(tok::l_brace)) {
430 PP.Diag(Tok, diag::err_expected) << tok::l_brace;
434 SourceLocation Loc = Tok.getLocation();
456 assert(Tok.is(tok::annot_pragma_opencl_extension));
458 OpenCLExtData::getFromOpaqueValue(Tok.getAnnotationValue());
461 SourceLocation NameLoc = Tok.getLocation();
481 assert(Tok.is(tok::annot_pragma_ms_pointers_to_members));
484 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue()));
490 assert(Tok.is(tok::annot_pragma_ms_vtordisp));
491 uintptr_t Value = reinterpret_cast<uintptr_t>(Tok.getAnnotationValue());
500 assert(Tok.is(tok::annot_pragma_ms_pragma));
502 auto TheTokens = (std::pair<Token*, size_t> *)Tok.getAnnotationValue();
505 assert(Tok.isAnyIdentifier());
506 StringRef PragmaName = Tok.getIdentifierInfo()->getName();
507 PP.Lex(Tok); // pragma kind
523 while (Tok.isNot(tok::eof))
524 PP.Lex(Tok);
525 PP.Lex(Tok);
531 if (Tok.isNot(tok::l_paren)) {
535 PP.Lex(Tok); // (
537 if (Tok.isNot(tok::string_literal)) {
553 while (Tok.is(tok::comma)) {
554 PP.Lex(Tok); // ,
558 if (Tok.is(tok::kw_long) || Tok.is(tok::kw_short)) {
559 PP.Lex(Tok); // long/short
563 if (!Tok.isAnyIdentifier()) {
570 Tok.getIdentifierInfo()->getName())
584 << PragmaName << Tok.getIdentifierInfo()->getName();
589 PP.Lex(Tok); // Identifier
595 if (Tok.isNot(tok::r_paren)) {
599 PP.Lex(Tok); // )
600 if (Tok.isNot(tok::eof)) {
605 PP.Lex(Tok); // eof
612 if (Tok.isNot(tok::l_paren)) {
616 PP.Lex(Tok); // (
619 if (Tok.isAnyIdentifier()) {
620 StringRef PushPop = Tok.getIdentifierInfo()->getName();
632 PP.Lex(Tok); // push | pop
633 if (Tok.is(tok::comma)) {
634 PP.Lex(Tok); // ,
636 if (Tok.isAnyIdentifier()) {
637 SlotLabel = Tok.getIdentifierInfo()->getName();
638 PP.Lex(Tok); // identifier
639 if (Tok.is(tok::comma))
640 PP.Lex(Tok);
641 else if (Tok.isNot(tok::r_paren)) {
647 } else if (Tok.isNot(tok::r_paren)) {
655 if (Tok.isNot(tok::r_paren)) {
656 if (Tok.isNot(tok::string_literal)) {
677 if (Tok.isNot(tok::r_paren)) {
681 PP.Lex(Tok); // )
682 if (Tok.isNot(tok::eof)) {
687 PP.Lex(Tok); // eof
701 if (ExpectAndConsume(tok::l_paren, diag::warn_pragma_expected_lparen,
707 if (Tok.isAnyIdentifier()) {
708 auto *II = Tok.getIdentifierInfo();
719 Toks[0].setKind(tok::string_literal);
720 Toks[0].setLocation(Tok.getLocation());
725 PP.Lex(Tok);
727 } else if (Tok.is(tok::string_literal)) {
745 if (ExpectAndConsume(tok::r_paren, diag::warn_pragma_expected_rparen,
747 ExpectAndConsume(tok::eof, diag::warn_pragma_extra_tokens_at_eol,
777 assert(Tok.is(tok::annot_pragma_loop_hint));
779 static_cast<PragmaLoopHintInfo *>(Tok.getAnnotationValue());
787 IdentifierInfo *OptionInfo = Info->Option.is(tok::identifier)
824 if (Toks[0].is(tok::eof)) {
845 Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
858 if (Tok.isNot(tok::eof)) {
859 Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
861 while (Tok.isNot(tok::eof))
888 Token Tok;
889 PP.LexUnexpandedToken(Tok);
891 const IdentifierInfo *PushPop = Tok.getIdentifierInfo();
897 PP.LexUnexpandedToken(Tok);
898 if (Tok.isNot(tok::l_paren)) {
899 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
903 PP.LexUnexpandedToken(Tok);
904 VisType = Tok.getIdentifierInfo();
906 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
910 PP.LexUnexpandedToken(Tok);
911 if (Tok.isNot(tok::r_paren)) {
912 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
917 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
921 SourceLocation EndLoc = Tok.getLocation();
922 PP.LexUnexpandedToken(Tok);
923 if (Tok.isNot(tok::eod)) {
924 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
931 Toks[0].setKind(tok::annot_pragma_vis);
949 Token Tok;
950 PP.Lex(Tok);
951 if (Tok.isNot(tok::l_paren)) {
952 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "pack";
960 SourceLocation LParenLoc = Tok.getLocation();
961 PP.Lex(Tok);
962 if (Tok.is(tok::numeric_constant)) {
963 Alignment = Tok;
965 PP.Lex(Tok);
972 } else if (Tok.is(tok::identifier)) {
973 const IdentifierInfo *II = Tok.getIdentifierInfo();
976 PP.Lex(Tok);
983 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action) << "pack";
986 PP.Lex(Tok);
988 if (Tok.is(tok::comma)) {
989 PP.Lex(Tok);
991 if (Tok.is(tok::numeric_constant)) {
992 Alignment = Tok;
994 PP.Lex(Tok);
995 } else if (Tok.is(tok::identifier)) {
996 Name = Tok.getIdentifierInfo();
997 PP.Lex(Tok);
999 if (Tok.is(tok::comma)) {
1000 PP.Lex(Tok);
1002 if (Tok.isNot(tok::numeric_constant)) {
1003 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
1007 Alignment = Tok;
1009 PP.Lex(Tok);
1012 PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
1024 if (Tok.isNot(tok::r_paren)) {
1025 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen) << "pack";
1029 SourceLocation RParenLoc = Tok.getLocation();
1030 PP.Lex(Tok);
1031 if (Tok.isNot(tok::eod)) {
1032 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "pack";
1051 Toks[0].setKind(tok::annot_pragma_pack);
1066 Token Tok;
1067 PP.Lex(Tok);
1068 if (Tok.isNot(tok::identifier)) {
1069 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
1072 SourceLocation EndLoc = Tok.getLocation();
1073 const IdentifierInfo *II = Tok.getIdentifierInfo();
1076 PP.Lex(Tok);
1079 PP.Lex(Tok);
1081 PP.Diag(Tok.getLocation(), diag::warn_pragma_ms_struct);
1085 if (Tok.isNot(tok::eod)) {
1086 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1096 Toks[0].setKind(tok::annot_pragma_msstruct);
1109 Token Tok;
1112 PP.Lex(Tok);
1113 if (Tok.isNot(tok::identifier) ||
1114 !Tok.getIdentifierInfo()->isStr("align")) {
1115 PP.Diag(Tok.getLocation(), diag::warn_pragma_options_expected_align);
1120 PP.Lex(Tok);
1121 if (Tok.isNot(tok::equal)) {
1122 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_expected_equal)
1127 PP.Lex(Tok);
1128 if (Tok.isNot(tok::identifier)) {
1129 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1135 const IdentifierInfo *II = Tok.getIdentifierInfo();
1149 PP.Diag(Tok.getLocation(), diag::warn_pragma_align_invalid_option)
1154 SourceLocation EndLoc = Tok.getLocation();
1155 PP.Lex(Tok);
1156 if (Tok.isNot(tok::eod)) {
1157 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1167 Toks[0].setKind(tok::annot_pragma_align);
1196 Token Tok;
1197 PP.Lex(Tok);
1198 if (Tok.isNot(tok::l_paren)) {
1199 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "unused";
1209 PP.Lex(Tok);
1212 if (Tok.is(tok::identifier)) {
1213 Identifiers.push_back(Tok);
1219 PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_var);
1224 if (Tok.is(tok::comma)) {
1229 if (Tok.is(tok::r_paren)) {
1230 RParenLoc = Tok.getLocation();
1235 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_punc) << "unused";
1239 PP.Lex(Tok);
1240 if (Tok.isNot(tok::eod)) {
1241 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1261 pragmaUnusedTok.setKind(tok::annot_pragma_unused);
1276 Token Tok;
1277 PP.Lex(Tok);
1278 if (Tok.isNot(tok::identifier)) {
1279 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) << "weak";
1283 Token WeakName = Tok;
1287 PP.Lex(Tok);
1288 if (Tok.is(tok::equal)) {
1290 PP.Lex(Tok);
1291 if (Tok.isNot(tok::identifier)) {
1292 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1296 AliasName = Tok;
1297 PP.Lex(Tok);
1300 if (Tok.isNot(tok::eod)) {
1301 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "weak";
1311 pragmaUnusedTok.setKind(tok::annot_pragma_weakalias);
1324 pragmaUnusedTok.setKind(tok::annot_pragma_weak);
1339 Token Tok;
1340 PP.Lex(Tok);
1341 if (Tok.isNot(tok::identifier)) {
1342 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
1347 Token RedefName = Tok;
1348 PP.Lex(Tok);
1350 if (Tok.isNot(tok::identifier)) {
1351 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1356 Token AliasName = Tok;
1357 PP.Lex(Tok);
1359 if (Tok.isNot(tok::eod)) {
1360 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1370 pragmaRedefTok.setKind(tok::annot_pragma_redefine_extname);
1383 Token &Tok) {
1384 tok::OnOffSwitch OOS;
1393 Toks[0].setKind(tok::annot_pragma_fp_contract);
1394 Toks[0].setLocation(Tok.getLocation());
1395 Toks[0].setAnnotationEndLoc(Tok.getLocation());
1405 Token &Tok) {
1406 PP.LexUnexpandedToken(Tok);
1407 if (Tok.isNot(tok::identifier)) {
1408 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) <<
1412 IdentifierInfo *ename = Tok.getIdentifierInfo();
1413 SourceLocation NameLoc = Tok.getLocation();
1415 PP.Lex(Tok);
1416 if (Tok.isNot(tok::colon)) {
1417 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_colon) << ename;
1421 PP.Lex(Tok);
1422 if (Tok.isNot(tok::identifier)) {
1423 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_enable_disable);
1426 IdentifierInfo *op = Tok.getIdentifierInfo();
1434 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_enable_disable);
1437 SourceLocation StateLoc = Tok.getLocation();
1439 PP.Lex(Tok);
1440 if (Tok.isNot(tok::eod)) {
1441 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
1452 Toks[0].setKind(tok::annot_pragma_opencl_extension);
1486 Token Tok;
1487 Tok.startToken();
1488 Tok.setKind(tok::annot_pragma_openmp);
1489 Tok.setLocation(FirstTok.getLocation());
1491 while (Tok.isNot(tok::eod)) {
1492 Pragma.push_back(Tok);
1493 PP.Lex(Tok);
1495 SourceLocation EodLoc = Tok.getLocation();
1496 Tok.startToken();
1497 Tok.setKind(tok::annot_pragma_openmp_end);
1498 Tok.setLocation(EodLoc);
1499 Pragma.push_back(Tok);
1517 Token &Tok) {
1518 SourceLocation PointersToMembersLoc = Tok.getLocation();
1519 PP.Lex(Tok);
1520 if (Tok.isNot(tok::l_paren)) {
1525 PP.Lex(Tok);
1526 const IdentifierInfo *Arg = Tok.getIdentifierInfo();
1528 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
1532 PP.Lex(Tok);
1539 if (Tok.is(tok::comma)) {
1540 PP.Lex(Tok);
1542 Arg = Tok.getIdentifierInfo();
1544 PP.Diag(Tok.getLocation(),
1546 << Tok.getKind() << /*OnlyInheritanceModels*/ 0;
1549 PP.Lex(Tok);
1550 } else if (Tok.is(tok::r_paren)) {
1556 PP.Diag(Tok.getLocation(), diag::err_expected_punc)
1573 PP.Diag(Tok.getLocation(),
1581 if (Tok.isNot(tok::r_paren)) {
1582 PP.Diag(Tok.getLocation(), diag::err_expected_rparen_after)
1587 SourceLocation EndLoc = Tok.getLocation();
1588 PP.Lex(Tok);
1589 if (Tok.isNot(tok::eod)) {
1590 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1597 AnnotTok.setKind(tok::annot_pragma_ms_pointers_to_members);
1615 Token &Tok) {
1616 SourceLocation VtorDispLoc = Tok.getLocation();
1617 PP.Lex(Tok);
1618 if (Tok.isNot(tok::l_paren)) {
1622 PP.Lex(Tok);
1625 const IdentifierInfo *II = Tok.getIdentifierInfo();
1629 PP.Lex(Tok);
1630 if (Tok.isNot(tok::comma)) {
1634 PP.Lex(Tok);
1639 PP.Lex(Tok);
1644 if (Tok.is(tok::r_paren)) {
1653 const IdentifierInfo *II = Tok.getIdentifierInfo();
1655 PP.Lex(Tok);
1658 PP.Lex(Tok);
1660 } else if (Tok.is(tok::numeric_constant) &&
1661 PP.parseSimpleIntegerLiteral(Tok, Value)) {
1663 PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_integer)
1668 PP.Diag(Tok.getLocation(), diag::warn_pragma_invalid_action)
1675 if (Tok.isNot(tok::r_paren)) {
1679 SourceLocation EndLoc = Tok.getLocation();
1680 PP.Lex(Tok);
1681 if (Tok.isNot(tok::eod)) {
1682 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
1690 AnnotTok.setKind(tok::annot_pragma_ms_vtordisp);
1702 Token &Tok) {
1705 EoF.setKind(tok::eof);
1707 AnnotTok.setKind(tok::annot_pragma_ms_pragma);
1708 AnnotTok.setLocation(Tok.getLocation());
1709 AnnotTok.setAnnotationEndLoc(Tok.getLocation());
1712 for (; Tok.isNot(tok::eod); PP.Lex(Tok)) {
1713 TokenVector.push_back(Tok);
1714 AnnotTok.setAnnotationEndLoc(Tok.getLocation());
1740 Token &Tok) {
1741 SourceLocation CommentLoc = Tok.getLocation();
1742 PP.Lex(Tok);
1743 if (Tok.isNot(tok::l_paren)) {
1744 PP.Diag(CommentLoc, diag::err_expected) << tok::l_paren;
1750 if (!PP.LexStringLiteral(Tok, NameString,
1757 if (Tok.isNot(tok::comma)) {
1758 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
1762 if (!PP.LexStringLiteral(Tok, ValueString, "pragma detect_mismatch",
1766 if (Tok.isNot(tok::r_paren)) {
1767 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
1770 PP.Lex(Tok); // Eat the r_paren.
1772 if (Tok.isNot(tok::eod)) {
1773 PP.Diag(Tok.getLocation(), diag::err_pragma_detect_mismatch_malformed);
1796 Token &Tok) {
1797 SourceLocation CommentLoc = Tok.getLocation();
1798 PP.Lex(Tok);
1799 if (Tok.isNot(tok::l_paren)) {
1805 PP.Lex(Tok);
1806 if (Tok.isNot(tok::identifier)) {
1812 IdentifierInfo *II = Tok.getIdentifierInfo();
1822 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_unknown_kind);
1829 PP.Diag(Tok.getLocation(), diag::warn_pragma_comment_ignored)
1835 PP.Lex(Tok);
1837 if (Tok.is(tok::comma) && !PP.LexStringLiteral(Tok, ArgumentString,
1849 if (Tok.isNot(tok::r_paren)) {
1850 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
1853 PP.Lex(Tok); // eat the r_paren.
1855 if (Tok.isNot(tok::eod)) {
1856 PP.Diag(Tok.getLocation(), diag::err_pragma_comment_malformed);
1872 Token Tok;
1873 PP.Lex(Tok);
1874 if (Tok.is(tok::eod)) {
1875 PP.Diag(Tok.getLocation(), diag::err_pragma_missing_argument)
1879 if (Tok.isNot(tok::identifier)) {
1880 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
1881 << PP.getSpelling(Tok);
1884 const IdentifierInfo *II = Tok.getIdentifierInfo();
1890 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_invalid_argument)
1891 << PP.getSpelling(Tok);
1894 PP.Lex(Tok);
1896 if (Tok.isNot(tok::eod)) {
1897 PP.Diag(Tok.getLocation(), diag::err_pragma_optimize_extra_argument)
1898 << PP.getSpelling(Tok);
1906 static bool ParseLoopHintValue(Preprocessor &PP, Token &Tok, Token PragmaName,
1912 while (Tok.isNot(tok::eod)) {
1913 if (Tok.is(tok::l_paren))
1915 else if (Tok.is(tok::r_paren)) {
1921 Tok);
1922 PP.Lex(Tok);
1927 if (Tok.isNot(tok::r_paren)) {
1928 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
1931 PP.Lex(Tok);
1936 EOFTok.setKind(tok::eof);
1937 EOFTok.setLocation(Tok.getLocation());
1994 Token &Tok) {
1996 Token PragmaName = Tok;
2000 PP.Lex(Tok);
2001 if (Tok.isNot(tok::identifier)) {
2002 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
2007 while (Tok.is(tok::identifier)) {
2008 Token Option = Tok;
2009 IdentifierInfo *OptionInfo = Tok.getIdentifierInfo();
2020 PP.Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_option)
2024 PP.Lex(Tok);
2027 if (Tok.isNot(tok::l_paren)) {
2028 PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
2031 PP.Lex(Tok);
2034 if (ParseLoopHintValue(PP, Tok, PragmaName, Option, /*ValueInParens=*/true,
2041 LoopHintTok.setKind(tok::annot_pragma_loop_hint);
2048 if (Tok.isNot(tok::eod)) {
2049 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2081 Token &Tok) {
2084 Token PragmaName = Tok;
2085 PP.Lex(Tok);
2087 if (Tok.is(tok::eod)) {
2092 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2099 bool ValueInParens = Tok.is(tok::l_paren);
2101 PP.Lex(Tok);
2105 if (ParseLoopHintValue(PP, Tok, PragmaName, Option, ValueInParens, *Info))
2114 if (Tok.isNot(tok::eod)) {
2115 PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
2124 TokenArray[0].setKind(tok::annot_pragma_loop_hint);