aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-12 03:30:33 +0000
committerDale Johannesen <dalej@apple.com>2007-09-12 03:30:33 +0000
commit028084efe5a297af30f17ab0f82d3bf86199372f (patch)
tree18f308de05f1332e6f12226bef3fd98a3b7a57c0 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent521988b604c42f28eca7910e428feb8f221f9314 (diff)
downloadllvm-028084efe5a297af30f17ab0f82d3bf86199372f.zip
llvm-028084efe5a297af30f17ab0f82d3bf86199372f.tar.gz
llvm-028084efe5a297af30f17ab0f82d3bf86199372f.tar.bz2
Revise previous patch per review comments.
Next round of x87 long double stuff. Getting close now, basically works. llvm-svn: 41875
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 78a16d8..fdaa9be5 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -526,11 +526,8 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
} 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((uint32_t)*CFP->getValueAPF().convertToAPInt().
- getRawData());
- else if (Ty == Type::DoubleTy) {
- Record.push_back(*CFP->getValueAPF().convertToAPInt().getRawData());
+ if (Ty == Type::FloatTy || Ty == Type::DoubleTy) {
+ Record.push_back(CFP->getValueAPF().convertToAPInt().getZExtValue());
} else if (Ty == Type::X86_FP80Ty) {
const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
Record.push_back(p[0]);