Home | History | Annotate | Download | only in Lex

Lines Matching refs:PP

78                                      Preprocessor &PP);
103 bool ValueLive, Preprocessor &PP) {
108 PP.LexUnexpandedNonComment(PeekTok);
110 // Two options, it can either be a pp-identifier or a (.
115 PP.LexUnexpandedNonComment(PeekTok);
119 if (PP.getCodeCompletionHandler())
120 PP.getCodeCompletionHandler()->CodeCompleteMacroName(false);
121 PP.setCodeCompletionReached();
122 PP.LexUnexpandedNonComment(PeekTok);
125 // If we don't have a pp-identifier now, this is an error.
126 if (PP.CheckMacroName(PeekTok, MU_Other))
131 MacroDefinition Macro = PP.getMacroDefinition(II);
138 PP.markMacroAsUsed(Macro.getMacroInfo());
147 PP.LexUnexpandedNonComment(PeekTok);
150 PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_after)
152 PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren;
156 PP.LexNonComment(PeekTok);
161 PP.LexNonComment(PeekTok);
184 PP.getSourceManager()
185 .getSLocEntry(PP.getSourceManager().getFileID(beginLoc))
204 PP.Diag(beginLoc, diag::warn_defined_in_function_type_macro);
206 PP.Diag(beginLoc, diag::warn_defined_in_object_type_macro);
210 if (PPCallbacks *Callbacks = PP.getPPCallbacks()) {
230 bool ValueLive, Preprocessor &PP) {
236 if (PP.getCodeCompletionHandler())
237 PP.getCodeCompletionHandler()->CodeCompletePreprocessorExpression();
238 PP.setCodeCompletionReached();
239 PP.LexNonComment(PeekTok);
244 // If this token's spelling is a pp-identifier, check to see if it is
246 // keywords are pp-identifiers, so we can't check the kind.
250 return EvaluateDefined(Result, PeekTok, DT, ValueLive, PP);
257 PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II;
259 const DiagnosticsEngine &DiagEngine = PP.getDiagnostics();
270 PP.Diag(PeekTok, diag::warn_pp_undef_prefix)
279 PP.LexNonComment(PeekTok);
283 PP.Diag(PeekTok, diag::err_pp_expr_bad_token_start_expr);
288 PP.Diag(PeekTok, diag::err_pp_expected_value_in_expr);
293 StringRef Spelling = PP.getSpelling(PeekTok, IntegerBuffer,
299 PP.getSourceManager(), PP.getLangOpts(),
300 PP.getTargetInfo(), PP.getDiagnostics());
305 PP.Diag(PeekTok, diag::err_pp_illegal_floating_literal);
312 PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*integer*/1;
315 if (!PP.getLangOpts().C99 && Literal.isLongLong) {
316 if (PP.getLangOpts().CPlusPlus)
317 PP.Diag(PeekTok,
318 PP.getLangOpts().CPlusPlus11 ?
321 PP.Diag(PeekTok, diag::ext_c99_longlong);
326 PP.Diag(PeekTok, PP.getLangOpts().CPlusPlus
327 ? PP.getLangOpts().CPlusPlus2b
336 PP.Diag(PeekTok, diag::err_integer_literal_too_large)
352 PP.Diag(PeekTok, diag::ext_integer_literal_too_large_for_signed);
359 PP.LexNonComment(PeekTok);
369 PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*character*/0;
373 StringRef ThisTok = PP.getSpelling(PeekTok, CharBuffer, &CharInvalid);
378 PeekTok.getLocation(), PP, PeekTok.getKind());
383 const TargetInfo &TI = PP.getTargetInfo();
404 Val.setIsUnsigned(!PP.getLangOpts().CharIsSigned);
416 PP.LexNonComment(PeekTok);
421 PP.LexNonComment(PeekTok); // Eat the (.
424 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
433 DT.IncludedUndefinedIds, PP))
437 PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_rparen)
439 PP.Diag(Start, diag::note_matching) << tok::l_paren;
446 PP.LexNonComment(PeekTok); // Eat the ).
452 PP.LexNonComment(PeekTok);
453 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
460 PP.LexNonComment(PeekTok);
461 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
473 PP.Diag(Loc, diag::warn_pp_expr_overflow) << Result.getRange();
481 PP.LexNonComment(PeekTok);
482 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
494 PP.LexNonComment(PeekTok);
495 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
514 PP.LexNonComment(PeekTok);
555 static void diagnoseUnexpectedOperator(Preprocessor &PP, PPValue &LHS,
558 PP.Diag(LHS.getRange().getBegin(), diag::err_pp_expr_bad_token_lparen)
561 PP.Diag(Tok.getLocation(), diag::err_pp_expr_bad_token_binop)
574 Preprocessor &PP) {
578 diagnoseUnexpectedOperator(PP, LHS, PeekTok);
607 PP.LexNonComment(PeekTok);
612 if (EvaluateValue(RHS, PeekTok, DT, RHSIsLive, PP)) return true;
622 diagnoseUnexpectedOperator(PP, RHS, PeekTok);
645 IncludedUndefinedIds, PP))
668 PP.Diag(OpLoc, diag::warn_pp_convert_to_positive) << 0
673 PP.Diag(OpLoc, diag::warn_pp_convert_to_positive) << 1
689 PP.Diag(OpLoc, diag::err_pp_remainder_by_zero)
701 PP.Diag(OpLoc, diag::err_pp_division_by_zero)
785 // Comma is invalid in pp expressions in c89/c++ mode, but is valid in C99
787 if (!PP.getLangOpts().C99 || ValueLive)
788 PP.Diag(OpLoc, diag::ext_pp_comma_expr)
795 PP.Diag(PeekTok.getLocation(), diag::err_expected)
797 PP.Diag(OpLoc, diag::note_matching) << tok::question;
801 PP.LexNonComment(PeekTok);
807 if (EvaluateValue(AfterColonVal, PeekTok, DT, AfterColonLive, PP))
814 IncludedUndefinedIds, PP))
831 PP.Diag(OpLoc, diag::err_pp_colon_without_question)
838 PP.Diag(OpLoc, diag::warn_pp_expr_overflow)