Replace APFloatBase static fltSemantics data members with getter functions
At least the plugin used by the LibreOffice build
(<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly
uses those members (through inline functions in LLVM/Clang include files in turn
using them), but they are not exported by utils/extract_symbols.py on Windows,
and accessing data across DLL/EXE boundaries on Windows is generally
problematic.
Differential Revision: https://reviews.llvm.org/D26671
llvm-svn: 289647
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index e14ea78..098ff90 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -590,13 +590,13 @@
if (ConstantFP *FPC = dyn_cast<ConstantFP>(V)) {
bool ignored;
APFloat Val = FPC->getValueAPF();
- Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf :
- DestTy->isFloatTy() ? APFloat::IEEEsingle :
- DestTy->isDoubleTy() ? APFloat::IEEEdouble :
- DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended :
- DestTy->isFP128Ty() ? APFloat::IEEEquad :
- DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble :
- APFloat::Bogus,
+ Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf() :
+ DestTy->isFloatTy() ? APFloat::IEEEsingle() :
+ DestTy->isDoubleTy() ? APFloat::IEEEdouble() :
+ DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended() :
+ DestTy->isFP128Ty() ? APFloat::IEEEquad() :
+ DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble() :
+ APFloat::Bogus(),
APFloat::rmNearestTiesToEven, &ignored);
return ConstantFP::get(V->getContext(), Val);
}