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
This commit is contained in:
@@ -1996,26 +1996,26 @@ Error BitcodeReader::parseConstants() {
|
||||
if (Record.empty())
|
||||
return error("Invalid record");
|
||||
if (CurTy->isHalfTy())
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEhalf,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEhalf(),
|
||||
APInt(16, (uint16_t)Record[0])));
|
||||
else if (CurTy->isFloatTy())
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEsingle,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEsingle(),
|
||||
APInt(32, (uint32_t)Record[0])));
|
||||
else if (CurTy->isDoubleTy())
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEdouble,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEdouble(),
|
||||
APInt(64, Record[0])));
|
||||
else if (CurTy->isX86_FP80Ty()) {
|
||||
// Bits are not stored the same way as a normal i80 APInt, compensate.
|
||||
uint64_t Rearrange[2];
|
||||
Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16);
|
||||
Rearrange[1] = Record[0] >> 48;
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::x87DoubleExtended,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::x87DoubleExtended(),
|
||||
APInt(80, Rearrange)));
|
||||
} else if (CurTy->isFP128Ty())
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEquad,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::IEEEquad(),
|
||||
APInt(128, Record)));
|
||||
else if (CurTy->isPPC_FP128Ty())
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::PPCDoubleDouble,
|
||||
V = ConstantFP::get(Context, APFloat(APFloat::PPCDoubleDouble(),
|
||||
APInt(128, Record)));
|
||||
else
|
||||
V = UndefValue::get(CurTy);
|
||||
|
||||
Reference in New Issue
Block a user