aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-26 23:20:33 +0000
committerDale Johannesen <dalej@apple.com>2007-09-26 23:20:33 +0000
commit693aa823259fb40d9e7b699015a15b20e9c9c024 (patch)
treee58ba79eb59d3a41ea85479e75e40e24bf5f823f /lib/Bitcode/Writer/BitcodeWriter.cpp
parent502b0756e0ed0453b91fd964600c972dc832e7a4 (diff)
downloadexternal_llvm-693aa823259fb40d9e7b699015a15b20e9c9c024.zip
external_llvm-693aa823259fb40d9e7b699015a15b20e9c9c024.tar.gz
external_llvm-693aa823259fb40d9e7b699015a15b20e9c9c024.tar.bz2
Make temporaries explicit to avoid premature
destruction of compiler-created ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index fdaa9be..7999907 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -529,11 +529,14 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
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();
+ // api needed to prevent premature destruction
+ APInt api = CFP->getValueAPF().convertToAPInt();
+ const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back((uint16_t)p[1]);
} else if (Ty == Type::FP128Ty) {
- const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
+ APInt api = CFP->getValueAPF().convertToAPInt();
+ const uint64_t *p = api.getRawData();
Record.push_back(p[0]);
Record.push_back(p[1]);
} else if (Ty == Type::PPC_FP128Ty) {