зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
a90d56ea04
Коммит
ee5a700af3
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче