]> granicus.if.org Git - clang/commitdiff
Adjust calls to APFloat conversion for new interface.
authorDale Johannesen <dalej@apple.com>
Thu, 9 Oct 2008 23:02:32 +0000 (23:02 +0000)
committerDale Johannesen <dalej@apple.com>
Thu, 9 Oct 2008 23:02:32 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57332 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/CodeGen/CGExprScalar.cpp

index dfe412f4fc9aa66b7311e0f31847ede64e790fb9..943cd9a05775dcead92e5536279c6f32be474e29 100644 (file)
@@ -29,7 +29,9 @@ using namespace clang;
 /// debugging dumps, etc.
 double FloatingLiteral::getValueAsApproximateDouble() const {
   llvm::APFloat V = getValue();
-  V.convert(llvm::APFloat::IEEEdouble, llvm::APFloat::rmNearestTiesToEven);
+  bool ignored;
+  V.convert(llvm::APFloat::IEEEdouble, llvm::APFloat::rmNearestTiesToEven,
+            &ignored);
   return V.convertToDouble();
 }
 
@@ -977,9 +979,11 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
 
     // TODO: Warn on overflow, but probably not here: isIntegerConstantExpr can
     // be called multiple times per AST.
-    uint64_t Space[4]; 
+    uint64_t Space[4];
+    bool ignored;
     (void)FL->getValue().convertToInteger(Space, DestWidth, DestSigned,
-                                          llvm::APFloat::rmTowardZero);
+                                          llvm::APFloat::rmTowardZero,
+                                          &ignored);
     Result = llvm::APInt(DestWidth, 4, Space);
     break;
   }
index 01dad74fa1857eced30754c650e5bb40e12ca7ca..2b94964a9189a216b9331c3b4fb3e914826b4913 100644 (file)
@@ -557,9 +557,10 @@ bool IntExprEvaluator::HandleCast(SourceLocation CastLoc,
   bool DestSigned = DestType->isSignedIntegerType();
   
   // FIXME: Warning for overflow.
-  uint64_t Space[4]; 
+  uint64_t Space[4];
+  bool ignored;
   (void)F.convertToInteger(Space, DestWidth, DestSigned,
-                           llvm::APFloat::rmTowardZero);
+                           llvm::APFloat::rmTowardZero, &ignored);
   Result = llvm::APInt(DestWidth, 4, Space);
   Result.setIsUnsigned(!DestSigned);
   return true;
index 88b8c9edefd50b12ec77eba53ff5647a2c4bddfb..c4d3377e44c8f1694c7cc4eb25f6b44ec5b1b1e7 100644 (file)
@@ -605,7 +605,9 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E,
         llvm::ConstantFP::get(llvm::APFloat(static_cast<double>(AmountVal)));
     else {
       llvm::APFloat F(static_cast<float>(AmountVal));
-      F.convert(CGF.Target.getLongDoubleFormat(), llvm::APFloat::rmTowardZero);
+      bool ignored;
+      F.convert(CGF.Target.getLongDoubleFormat(), llvm::APFloat::rmTowardZero,
+                &ignored);
       NextVal = llvm::ConstantFP::get(F);
     }
     NextVal = Builder.CreateAdd(InVal, NextVal, isInc ? "inc" : "dec");