[cfe-commits] r54069 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Chris Lattner sabre at nondot.org
Fri Jul 25 15:25:12 PDT 2008


Author: lattner
Date: Fri Jul 25 17:25:12 2008
New Revision: 54069

URL: http://llvm.org/viewvc/llvm-project?rev=54069&view=rev
Log:
move a method.

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Jul 25 17:25:12 2008
@@ -32,21 +32,6 @@
 //  Standard Promotions and Conversions
 //===----------------------------------------------------------------------===//
 
-/// DefaultArgumentPromotion (C99 6.5.2.2p6). Used for function calls that
-/// do not have a prototype. Arguments that have type float are promoted to 
-/// double. All other argument types are converted by UsualUnaryConversions().
-void Sema::DefaultArgumentPromotion(Expr *&Expr) {
-  QualType Ty = Expr->getType();
-  assert(!Ty.isNull() && "DefaultArgumentPromotion - missing type");
-
-  // If this is a 'float' (CVR qualified or typedef) promote to double.
-  if (const BuiltinType *BT = Ty->getAsBuiltinType())
-    if (BT->getKind() == BuiltinType::Float)
-      return ImpCastExprToType(Expr, Context.DoubleTy);
-  
-  UsualUnaryConversions(Expr);
-}
-
 /// DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
 void Sema::DefaultFunctionArrayConversion(Expr *&E) {
   QualType Ty = E->getType();
@@ -91,6 +76,21 @@
   return Expr;
 }
 
+/// DefaultArgumentPromotion (C99 6.5.2.2p6). Used for function calls that
+/// do not have a prototype. Arguments that have type float are promoted to 
+/// double. All other argument types are converted by UsualUnaryConversions().
+void Sema::DefaultArgumentPromotion(Expr *&Expr) {
+  QualType Ty = Expr->getType();
+  assert(!Ty.isNull() && "DefaultArgumentPromotion - missing type");
+  
+  // If this is a 'float' (CVR qualified or typedef) promote to double.
+  if (const BuiltinType *BT = Ty->getAsBuiltinType())
+    if (BT->getKind() == BuiltinType::Float)
+      return ImpCastExprToType(Expr, Context.DoubleTy);
+  
+  UsualUnaryConversions(Expr);
+}
+
 /// UsualArithmeticConversions - Performs various conversions that are common to
 /// binary operators (C99 6.3.1.8). If both operands aren't arithmetic, this
 /// routine returns the first non-arithmetic type found. The client is 





More information about the cfe-commits mailing list