Lines Matching refs:Tok

81                                    Token &Tok) {
84 PP.LexUnexpandedToken(Tok);
88 = FindHandler(Tok.getIdentifierInfo() ? Tok.getIdentifierInfo()->getName()
92 PP.Diag(Tok, diag::warn_pragma_ignored);
97 Handler->HandlePragma(PP, Introducer, Tok);
117 Token Tok;
118 PragmaHandlers->HandlePragma(*this, Introducer, Tok);
137 Token &Tok)
139 Failed(false), OutTok(Tok) {
165 /// been read into 'Tok'.
166 void Preprocessor::Handle_Pragma(Token &Tok) {
179 LexingFor_PragmaRAII _PragmaLexing(*this, InMacroArgPreExpansion, Tok);
182 SourceLocation PragmaLoc = Tok.getLocation();
185 Lex(Tok);
186 if (Tok.isNot(tok::l_paren)) {
192 Lex(Tok);
193 if (!tok::isStringLiteral(Tok.getKind())) {
196 if (Tok.isNot(tok::r_paren))
197 Lex(Tok);
198 if (Tok.is(tok::r_paren))
199 Lex(Tok);
203 if (Tok.hasUDSuffix()) {
204 Diag(Tok, diag::err_invalid_string_udl);
206 Lex(Tok);
207 if (Tok.is(tok::r_paren))
208 Lex(Tok);
213 Token StrTok = Tok;
216 Lex(Tok);
217 if (Tok.isNot(tok::r_paren)) {
225 SourceLocation RParenLoc = Tok.getLocation();
299 return Lex(Tok);
304 void Preprocessor::HandleMicrosoft__pragma(Token &Tok) {
306 SourceLocation PragmaLoc = Tok.getLocation();
309 Lex(Tok);
310 if (Tok.isNot(tok::l_paren)) {
318 Lex(Tok);
319 while (Tok.isNot(tok::eof)) {
320 PragmaToks.push_back(Tok);
321 if (Tok.is(tok::l_paren))
323 else if (Tok.is(tok::r_paren) && NumParens-- == 0)
325 Lex(Tok);
328 if (Tok.is(tok::eof)) {
348 return Lex(Tok);
376 Token Tok;
385 LexUnexpandedToken(Tok);
389 if (Tok.is(tok::eod)) return;
392 if (Tok.isNot(tok::raw_identifier)) {
393 Diag(Tok, diag::err_pp_invalid_poison);
399 IdentifierInfo *II = LookUpIdentifierInfo(Tok);
406 Diag(Tok, diag::pp_poisoning_existing_macro);
505 IdentifierInfo *Preprocessor::ParsePragmaPushOrPopMacro(Token &Tok) {
507 Token PragmaTok = Tok;
510 Lex(Tok);
511 if (Tok.isNot(tok::l_paren)) {
518 Lex(Tok);
519 if (Tok.isNot(tok::string_literal)) {
525 if (Tok.hasUDSuffix()) {
526 Diag(Tok, diag::err_invalid_string_udl);
531 std::string StrVal = getSpelling(Tok);
534 Lex(Tok);
535 if (Tok.isNot(tok::r_paren)) {
621 void Preprocessor::HandlePragmaIncludeAlias(Token &Tok) {
628 Lex(Tok);
629 if (Tok.isNot(tok::l_paren)) {
630 Diag(Tok, diag::warn_pragma_include_alias_expected) << "(";
655 Diag(Tok, diag::warn_pragma_include_alias_expected_filename);
661 Lex(Tok);
662 if (Tok.isNot(tok::comma)) {
663 Diag(Tok, diag::warn_pragma_include_alias_expected) << ",";
686 Diag(Tok, diag::warn_pragma_include_alias_expected_filename);
691 Lex(Tok);
692 if (Tok.isNot(tok::r_paren)) {
693 Diag(Tok, diag::warn_pragma_include_alias_expected) << ")";
784 Token Tok;
785 LexUnexpandedToken(Tok);
787 if (Tok.isNot(tok::identifier)) {
788 Diag(Tok, diag::ext_on_off_switch_syntax);
791 IdentifierInfo *II = Tok.getIdentifierInfo();
799 Diag(Tok, diag::ext_on_off_switch_syntax);
804 LexUnexpandedToken(Tok);
805 if (Tok.isNot(tok::eod))
806 Diag(Tok, diag::ext_pragma_syntax_eod);
862 Token Tok;
863 PP.LexUnexpandedToken(Tok);
864 if (Tok.isNot(tok::identifier)) {
865 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
868 IdentifierInfo *II = Tok.getIdentifierInfo();
891 PP.Diag(Tok, diag::warn_pragma_debug_unexpected_command)
897 Callbacks->PragmaDebug(Tok.getLocation(), II->getName());
905 Token Tok;
906 PP.LexUnexpandedToken(Tok);
908 if (Tok.isNot(tok::eod)) {
909 PP.Diag(Tok, diag::ext_pp_extra_tokens_at_eol)
914 SourceLocation NameLoc = Tok.getLocation();
948 Token Tok;
949 PP.LexUnexpandedToken(Tok);
950 if (Tok.isNot(tok::identifier)) {
951 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
954 IdentifierInfo *II = Tok.getIdentifierInfo();
959 PP.Diag(Tok, diag::warn_pragma_diagnostic_cannot_pop);
978 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
982 PP.LexUnexpandedToken(Tok);
983 SourceLocation StringLoc = Tok.getLocation();
986 if (!PP.FinishLexStringLiteral(Tok, WarningName, "pragma diagnostic",
990 if (Tok.isNot(tok::eod)) {
991 PP.Diag(Tok.getLocation(), diag::warn_pragma_diagnostic_invalid_token);
1017 Token &Tok) override {
1022 SourceLocation DiagLoc = Tok.getLocation();
1025 PP.Lex(Tok);
1026 if (Tok.isNot(tok::l_paren)) {
1027 PP.Diag(Tok, diag::warn_pragma_warning_expected) << "(";
1031 PP.Lex(Tok);
1032 IdentifierInfo *II = Tok.getIdentifierInfo();
1034 PP.Diag(Tok, diag::warn_pragma_warning_spec_invalid);
1041 PP.Lex(Tok);
1042 if (Tok.is(tok::comma)) {
1043 PP.Lex(Tok);
1045 if (Tok.is(tok::numeric_constant) &&
1046 PP.parseSimpleIntegerLiteral(Tok, Value))
1049 PP.Diag(Tok, diag::warn_pragma_warning_push_level);
1057 PP.Lex(Tok);
1064 II = Tok.getIdentifierInfo();
1066 PP.Diag(Tok, diag::warn_pragma_warning_spec_invalid);
1078 PP.Diag(Tok, diag::warn_pragma_warning_spec_invalid);
1081 PP.Lex(Tok);
1082 if (Tok.isNot(tok::colon)) {
1083 PP.Diag(Tok, diag::warn_pragma_warning_expected) << ":";
1089 PP.Lex(Tok);
1090 while (Tok.is(tok::numeric_constant)) {
1092 if (!PP.parseSimpleIntegerLiteral(Tok, Value) || Value == 0 ||
1094 PP.Diag(Tok, diag::warn_pragma_warning_expected_number);
1103 if (Tok.isNot(tok::semi))
1105 PP.Lex(Tok);
1109 if (Tok.isNot(tok::r_paren)) {
1110 PP.Diag(Tok, diag::warn_pragma_warning_expected) << ")";
1114 PP.Lex(Tok);
1115 if (Tok.isNot(tok::eod))
1116 PP.Diag(Tok, diag::ext_pp_extra_tokens_at_eol) << "pragma warning";
1166 Token &Tok) override {
1167 SourceLocation MessageLoc = Tok.getLocation();
1168 PP.Lex(Tok);
1170 switch (Tok.getKind()) {
1175 PP.Lex(Tok);
1186 if (!PP.FinishLexStringLiteral(Tok, MessageString, PragmaKind(Kind),
1191 if (Tok.isNot(tok::r_paren)) {
1192 PP.Diag(Tok.getLocation(), diag::err_pragma_message_malformed) << Kind;
1195 PP.Lex(Tok); // eat the r_paren.
1198 if (Tok.isNot(tok::eod)) {
1199 PP.Diag(Tok.getLocation(), diag::err_pragma_message_malformed) << Kind;
1241 Token &Tok) override {
1246 PP.Diag(Tok, diag::warn_stdc_fenv_access_not_supported);
1255 Token &Tok) override {
1280 Token Tok;
1283 PP.LexUnexpandedToken(Tok);
1284 const IdentifierInfo *BeginEnd = Tok.getIdentifierInfo();
1290 PP.Diag(Tok.getLocation(), diag::err_pp_arc_cf_code_audited_syntax);
1295 PP.LexUnexpandedToken(Tok);
1296 if (Tok.isNot(tok::eod))
1297 PP.Diag(Tok, diag::ext_pp_extra_tokens_at_eol) << "pragma";