[llvm-commits] [llvm] r41769 - in /llvm/trunk/lib/Bitcode: Reader/BitcodeReader.cpp Writer/BitcodeWriter.cpp
Dale Johannesen
dalej at apple.com
Fri Sep 7 11:31:51 PDT 2007
Author: johannes
Date: Fri Sep 7 13:31:50 2007
New Revision: 41769
URL: http://llvm.org/viewvc/llvm-project?rev=41769&view=rev
Log:
Revert previous change to IR.
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=41769&r1=41768&r2=41769&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Sep 7 13:31:50 2007
@@ -626,7 +626,7 @@
if (Record.empty())
return Error("Invalid FLOAT record");
if (CurTy == Type::FloatTy)
- V = ConstantFP::get(CurTy, APFloat((float)BitsToDouble(Record[0])));
+ V = ConstantFP::get(CurTy, APFloat(BitsToFloat(Record[0])));
else if (CurTy == Type::DoubleTy)
V = ConstantFP::get(CurTy, APFloat(BitsToDouble(Record[0])));
// FIXME: Make long double constants work. BitsToDouble does not make it.
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=41769&r1=41768&r2=41769&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Sep 7 13:31:50 2007
@@ -526,10 +526,9 @@
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C)) {
Code = bitc::CST_CODE_FLOAT;
const Type *Ty = CFP->getType();
- if (Ty == Type::FloatTy) {
- Record.push_back(DoubleToBits((double)CFP->getValueAPF().
- convertToFloat()));
- } else if (Ty == Type::DoubleTy) {
+ if (Ty == Type::FloatTy)
+ Record.push_back(FloatToBits(CFP->getValueAPF().convertToFloat()));
+ else if (Ty == Type::DoubleTy) {
Record.push_back(DoubleToBits(CFP->getValueAPF().convertToDouble()));
// FIXME: make long double constants work.
} else if (Ty == Type::X86_FP80Ty ||
More information about the llvm-commits
mailing list