[cfe-commits] r41517 - /cfe/trunk/Sema/SemaExpr.cpp

Steve Naroff snaroff at apple.com
Mon Aug 27 14:43:43 PDT 2007


Author: snaroff
Date: Mon Aug 27 16:43:43 2007
New Revision: 41517

URL: http://llvm.org/viewvc/llvm-project?rev=41517&view=rev
Log:
Some minor aesthetic changes to the control flow.

Modified:
    cfe/trunk/Sema/SemaExpr.cpp

Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=41517&r1=41516&r2=41517&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Mon Aug 27 16:43:43 2007
@@ -837,19 +837,16 @@
     // does not require this promotion.
     if (lhs != rhs) { // Domains don't match, we have complex/float mix.
       if (lhs->isRealFloatingType()) { // handle "double, _Complex double".
-        if (isCompAssign)
-          return rhs;
-        promoteExprToType(lhsExpr, rhs);
+        if (!isCompAssign)
+          promoteExprToType(lhsExpr, rhs);
+        return rhs;
       } else { // handle "_Complex double, double".
-        if (isCompAssign)
-          return lhs;
-        promoteExprToType(rhsExpr, lhs);
+        if (!isCompAssign)
+          promoteExprToType(rhsExpr, lhs);
+        return lhs;
       }
-      // Both expressions now have the same rank/domain.
-      return lhsExpr->getType();
     }
-    // The domain/size match, simply return lhs (which may have been converted).
-    return lhs;
+    return lhs; // The domain/size match exactly.
   }
   // Now handle "real" floating types (i.e. float, double, long double).
   if (lhs->isRealFloatingType() || rhs->isRealFloatingType()) {





More information about the cfe-commits mailing list