]> granicus.if.org Git - clang/commitdiff
use simplified API for making fp constants.
authorChris Lattner <sabre@nondot.org>
Sun, 4 May 2008 18:23:51 +0000 (18:23 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 4 May 2008 18:23:51 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50623 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CGExprComplex.cpp

index 4097b6edbd2fae2fc42350b91984a07e9a014f00..98e01b04a55994be5cbd4562d4f6e055878aca9e 100644 (file)
@@ -193,14 +193,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
   }
   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:
index 45c0a40c90bea2f9d1232c3f00287d485361b26e..92b17e04d8e3681a35778980310a2588e3845560 100644 (file)
@@ -301,14 +301,12 @@ ComplexPairTy ComplexExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
   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.