Move ConstantFP construction back to the 2.5-ish API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-27 20:59:43 +00:00
parent 9a31254d0e
commit 6f83c9c6ef
26 changed files with 188 additions and 207 deletions

View File

@ -896,19 +896,19 @@ bool BitcodeReader::ParseConstants() {
if (Record.empty())
return Error("Invalid FLOAT record");
if (CurTy == Type::FloatTy)
V = Context.getConstantFP(APFloat(APInt(32, (uint32_t)Record[0])));
V = ConstantFP::get(Context, APFloat(APInt(32, (uint32_t)Record[0])));
else if (CurTy == Type::DoubleTy)
V = Context.getConstantFP(APFloat(APInt(64, Record[0])));
V = ConstantFP::get(Context, APFloat(APInt(64, Record[0])));
else if (CurTy == Type::X86_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 = Context.getConstantFP(APFloat(APInt(80, 2, Rearrange)));
V = ConstantFP::get(Context, APFloat(APInt(80, 2, Rearrange)));
} else if (CurTy == Type::FP128Ty)
V = Context.getConstantFP(APFloat(APInt(128, 2, &Record[0]), true));
V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0]), true));
else if (CurTy == Type::PPC_FP128Ty)
V = Context.getConstantFP(APFloat(APInt(128, 2, &Record[0])));
V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0])));
else
V = Context.getUndef(CurTy);
break;