From: Dale Johannesen Date: Thu, 9 Oct 2008 23:02:32 +0000 (+0000) Subject: Adjust calls to APFloat conversion for new interface. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee5a700af3fe9ae1a639c271f093f40677dddc04;p=clang Adjust calls to APFloat conversion for new interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57332 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index dfe412f4fc..943cd9a057 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -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; } diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 01dad74fa1..2b94964a91 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -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; diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 88b8c9edef..c4d3377e44 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -605,7 +605,9 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, llvm::ConstantFP::get(llvm::APFloat(static_cast(AmountVal))); else { llvm::APFloat F(static_cast(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");