diff options
author | Mike Stump <mrs@apple.com> | 2009-08-04 21:02:39 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-08-04 21:02:39 +0000 |
commit | ac5fc7c6bcb494b60fee7ce615ac931c5db6135e (patch) | |
tree | bc35a259aa268b722facf196fc38cf19480ae517 /lib/Sema/SemaChecking.cpp | |
parent | 06758d0ea712795fe0ff5c2dee4b9a162569dfef (diff) |
Canonicalize else.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index e217299451..d6095fc2ae 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -751,8 +751,7 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, if (const ArrayType *AT = Context.getAsArrayType(T)) { isConstant = AT->getElementType().isConstant(Context); - } - else if (const PointerType *PT = T->getAs<PointerType>()) { + } else if (const PointerType *PT = T->getAs<PointerType>()) { isConstant = T.isConstant(Context) && PT->getPointeeType().isConstant(Context); } @@ -1205,9 +1204,8 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType, if (C->hasBlockDeclRefExprs()) Diag(C->getLocStart(), diag::err_ret_local_block) << C->getSourceRange(); - } - // Perform checking for stack values returned by reference. - else if (lhsType->isReferenceType()) { + } else if (lhsType->isReferenceType()) { + // Perform checking for stack values returned by reference. // Check for a reference to the stack if (DeclRefExpr *DR = EvalVal(RetValExp)) Diag(DR->getLocStart(), diag::warn_ret_stack_ref) @@ -1444,8 +1442,7 @@ void Sema::CheckFloatComparison(SourceLocation loc, Expr* lex, Expr *rex) { if (FloatingLiteral* FLL = dyn_cast<FloatingLiteral>(LeftExprSansParen)) { if (FLL->isExact()) EmitWarning = false; - } - else + } else if (FloatingLiteral* FLR = dyn_cast<FloatingLiteral>(RightExprSansParen)){ if (FLR->isExact()) EmitWarning = false; |