[cfe-commits] r50623 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CGExprComplex.cpp

Chris Lattner sabre at nondot.org
Sun May 4 11:23:51 PDT 2008


Author: lattner
Date: Sun May  4 13:23:51 2008
New Revision: 50623

URL: http://llvm.org/viewvc/llvm-project?rev=50623&view=rev
Log:
use simplified API for making fp constants.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CGExprComplex.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=50623&r1=50622&r2=50623&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sun May  4 13:23:51 2008
@@ -193,14 +193,14 @@
   }
   case Builtin::BI__builtin_inff: {
     APFloat f(APFloat::IEEEsingle, APFloat::fcInfinity, false);
-    return RValue::get(ConstantFP::get(llvm::Type::FloatTy, f));
+    return RValue::get(ConstantFP::get(f));
   }
   case Builtin::BI__builtin_huge_val:
   case Builtin::BI__builtin_inf:
   // FIXME: mapping long double onto double.      
   case Builtin::BI__builtin_infl: {
     APFloat f(APFloat::IEEEdouble, APFloat::fcInfinity, false);
-    return RValue::get(ConstantFP::get(llvm::Type::DoubleTy, f));
+    return RValue::get(ConstantFP::get(f));
   }
   case Builtin::BI__builtin_isgreater:
   case Builtin::BI__builtin_isgreaterequal:

Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=50623&r1=50622&r2=50623&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Sun May  4 13:23:51 2008
@@ -301,14 +301,12 @@
   else if (InVal.first->getType() == llvm::Type::FloatTy)
     // FIXME: Handle long double.
     NextVal = 
-      llvm::ConstantFP::get(InVal.first->getType(), 
-                            llvm::APFloat(static_cast<float>(AmountVal)));
+      llvm::ConstantFP::get(llvm::APFloat(static_cast<float>(AmountVal)));
   else {
     // FIXME: Handle long double.
     assert(InVal.first->getType() == llvm::Type::DoubleTy);
     NextVal = 
-      llvm::ConstantFP::get(InVal.first->getType(), 
-                            llvm::APFloat(static_cast<double>(AmountVal)));
+      llvm::ConstantFP::get(llvm::APFloat(static_cast<double>(AmountVal)));
   }
   
   // Add the inc/dec to the real part.





More information about the cfe-commits mailing list