Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(764)

Delta Between Two Patch Sets: lib/Sema/SemaExpr.cpp

Issue 4859041: Refactor CheckConditionalOperands() (Closed) Base URL: https://llvm.org/svn/llvm-project/cfe/trunk/
Left Patch Set: Update base file and invert return values on check* functions. Created 13 years, 6 months ago
Right Patch Set: Fix incorrect conditional. Created 13 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 //===--- SemaExpr.cpp - Semantic Analysis for Expressions -----------------===// 1 //===--- SemaExpr.cpp - Semantic Analysis for Expressions -----------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements semantic analysis for expressions. 10 // This file implements semantic analysis for expressions.
(...skipping 4670 matching lines...) Expand 10 before | Expand all | Expand 10 after
4681 if (checkPointerIntegerMismatch(*this, LHS, RHS.get(), QuestionLoc, 4681 if (checkPointerIntegerMismatch(*this, LHS, RHS.get(), QuestionLoc,
4682 /*isIntFirstExpr=*/true)) 4682 /*isIntFirstExpr=*/true))
4683 return RHSTy; 4683 return RHSTy;
4684 if (checkPointerIntegerMismatch(*this, RHS, LHS.get(), QuestionLoc, 4684 if (checkPointerIntegerMismatch(*this, RHS, LHS.get(), QuestionLoc,
4685 /*isIntFirstExpr=*/false)) 4685 /*isIntFirstExpr=*/false))
4686 return LHSTy; 4686 return LHSTy;
4687 4687
4688 // Emit a better diagnostic if one of the expressions is a null pointer 4688 // Emit a better diagnostic if one of the expressions is a null pointer
4689 // constant and the other is not a pointer type. In this case, the user most 4689 // constant and the other is not a pointer type. In this case, the user most
4690 // likely forgot to take the address of the other expression. 4690 // likely forgot to take the address of the other expression.
4691 if (!DiagnoseConditionalForNull(LHS.get(), RHS.get(), QuestionLoc)) 4691 if (DiagnoseConditionalForNull(LHS.get(), RHS.get(), QuestionLoc))
4692 return QualType(); 4692 return QualType();
4693 4693
4694 // Otherwise, the operands are not compatible. 4694 // Otherwise, the operands are not compatible.
4695 Diag(QuestionLoc, diag::err_typecheck_cond_incompatible_operands) 4695 Diag(QuestionLoc, diag::err_typecheck_cond_incompatible_operands)
4696 << LHSTy << RHSTy << LHS.get()->getSourceRange() 4696 << LHSTy << RHSTy << LHS.get()->getSourceRange()
4697 << RHS.get()->getSourceRange(); 4697 << RHS.get()->getSourceRange();
4698 return QualType(); 4698 return QualType();
4699 } 4699 }
4700 4700
4701 /// FindCompositeObjCPointerType - Helper method to find composite type of 4701 /// FindCompositeObjCPointerType - Helper method to find composite type of
(...skipping 5265 matching lines...) Expand 10 before | Expand all | Expand 10 after
9967 return Owned(E); 9967 return Owned(E);
9968 } 9968 }
9969 9969
9970 bool Sema::CheckCaseExpression(Expr *expr) { 9970 bool Sema::CheckCaseExpression(Expr *expr) {
9971 if (expr->isTypeDependent()) 9971 if (expr->isTypeDependent())
9972 return true; 9972 return true;
9973 if (expr->isValueDependent() || expr->isIntegerConstantExpr(Context)) 9973 if (expr->isValueDependent() || expr->isIntegerConstantExpr(Context))
9974 return expr->getType()->isIntegralOrEnumerationType(); 9974 return expr->getType()->isIntegralOrEnumerationType();
9975 return false; 9975 return false;
9976 } 9976 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b