• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Lex/

Lines Matching refs:PeekTok

76                                      Token &PeekTok, bool ValueLive,
102 static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
104 SourceLocation beginLoc(PeekTok.getLocation());
108 PP.LexUnexpandedNonComment(PeekTok);
112 if (PeekTok.is(tok::l_paren)) {
114 LParenLoc = PeekTok.getLocation();
115 PP.LexUnexpandedNonComment(PeekTok);
118 if (PeekTok.is(tok::code_completion)) {
122 PP.LexUnexpandedNonComment(PeekTok);
126 if (PP.CheckMacroName(PeekTok, MU_Other))
130 IdentifierInfo *II = PeekTok.getIdentifierInfo();
141 Token macroToken(PeekTok);
146 Result.setEnd(PeekTok.getLocation());
147 PP.LexUnexpandedNonComment(PeekTok);
149 if (PeekTok.isNot(tok::r_paren)) {
150 PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_after)
156 PP.LexNonComment(PeekTok);
157 Result.setEnd(PeekTok.getLocation());
160 Result.setEnd(PeekTok.getLocation());
161 PP.LexNonComment(PeekTok);
212 SourceRange(beginLoc, PeekTok.getLocation()));
221 /// EvaluateValue - Evaluate the token PeekTok (and any others needed) and
229 static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
235 if (PeekTok.is(tok::code_completion)) {
239 PP.LexNonComment(PeekTok);
242 switch (PeekTok.getKind()) {
247 if (IdentifierInfo *II = PeekTok.getIdentifierInfo()) {
250 return EvaluateDefined(Result, PeekTok, DT, ValueLive, PP);
257 PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II;
262 PeekTok.getLocation())) {
270 PP.Diag(PeekTok, diag::warn_pp_undef_prefix)
277 Result.setRange(PeekTok.getLocation());
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,
298 NumericLiteralParser Literal(Spelling, PeekTok.getLocation(),
305 PP.Diag(PeekTok, diag::err_pp_illegal_floating_literal);
312 PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*integer*/1;
317 PP.Diag(PeekTok,
321 PP.Diag(PeekTok, diag::ext_c99_longlong);
328 PP.Diag(PeekTok, diag::err_integer_literal_too_large)
344 PP.Diag(PeekTok, diag::ext_integer_literal_too_large_for_signed);
350 Result.setRange(PeekTok.getLocation());
351 PP.LexNonComment(PeekTok);
360 if (PeekTok.hasUDSuffix())
361 PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*character*/0;
365 StringRef ThisTok = PP.getSpelling(PeekTok, CharBuffer, &CharInvalid);
370 PeekTok.getLocation(), PP, PeekTok.getKind());
407 Result.setRange(PeekTok.getLocation());
408 PP.LexNonComment(PeekTok);
412 SourceLocation Start = PeekTok.getLocation();
413 PP.LexNonComment(PeekTok); // Eat the (.
416 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
420 if (PeekTok.is(tok::r_paren)) {
424 if (EvaluateDirectiveSubExpr(Result, 1, PeekTok, ValueLive,
428 if (PeekTok.isNot(tok::r_paren)) {
429 PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_rparen)
436 Result.setRange(Start, PeekTok.getLocation());
438 PP.LexNonComment(PeekTok); // Eat the ).
442 SourceLocation Start = PeekTok.getLocation();
444 PP.LexNonComment(PeekTok);
445 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
451 SourceLocation Loc = PeekTok.getLocation();
452 PP.LexNonComment(PeekTok);
453 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
472 SourceLocation Start = PeekTok.getLocation();
473 PP.LexNonComment(PeekTok);
474 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
485 SourceLocation Start = PeekTok.getLocation();
486 PP.LexNonComment(PeekTok);
487 if (EvaluateValue(Result, PeekTok, DT, ValueLive, PP)) return true;
502 Result.Val = PeekTok.getKind() == tok::kw_true;
504 Result.setIdentifier(PeekTok.getIdentifierInfo());
505 Result.setRange(PeekTok.getLocation());
506 PP.LexNonComment(PeekTok);
558 /// PeekTok, and whose precedence is PeekPrec. This returns the result in LHS.
564 Token &PeekTok, bool ValueLive,
567 unsigned PeekPrec = getPrecedence(PeekTok.getKind());
570 diagnoseUnexpectedOperator(PP, LHS, PeekTok);
580 tok::TokenKind Operator = PeekTok.getKind();
598 SourceLocation OpLoc = PeekTok.getLocation();
599 PP.LexNonComment(PeekTok);
604 if (EvaluateValue(RHS, PeekTok, DT, RHSIsLive, PP)) return true;
610 PeekPrec = getPrecedence(PeekTok.getKind());
614 diagnoseUnexpectedOperator(PP, RHS, PeekTok);
636 if (EvaluateDirectiveSubExpr(RHS, RHSPrec, PeekTok, RHSIsLive,
639 PeekPrec = getPrecedence(PeekTok.getKind());
786 if (PeekTok.isNot(tok::colon)) {
787 PP.Diag(PeekTok.getLocation(), diag::err_expected)
793 PP.LexNonComment(PeekTok);
799 if (EvaluateValue(AfterColonVal, PeekTok, DT, AfterColonLive, PP))
805 PeekTok, AfterColonLive,
818 PeekPrec = getPrecedence(PeekTok.getKind());