diff options
| author | Dale Johannesen <dalej@apple.com> | 2007-09-26 23:20:33 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2007-09-26 23:20:33 +0000 |
| commit | 693717fbe6d4e0f63bb9927229e26851e4744530 (patch) | |
| tree | e58ba79eb59d3a41ea85479e75e40e24bf5f823f /lib/Target/CBackend | |
| parent | 0e99c53f646eea27aae24fad47ff7d9554b88422 (diff) | |
| download | external_llvm-693717fbe6d4e0f63bb9927229e26851e4744530.zip external_llvm-693717fbe6d4e0f63bb9927229e26851e4744530.tar.gz external_llvm-693717fbe6d4e0f63bb9927229e26851e4744530.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/Target/CBackend')
| -rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index bc08524..6eef297 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -1729,7 +1729,9 @@ void CWriter::printFloatingPointConstants(Function &F) { << " = 0x" << std::hex << i << std::dec << "U; /* " << Val << " */\n"; } else if (FPC->getType() == Type::X86_FP80Ty) { - const uint64_t *p = FPC->getValueAPF().convertToAPInt().getRawData(); + // api needed to prevent premature destruction + APInt api = FPC->getValueAPF().convertToAPInt(); + const uint64_t *p = api.getRawData(); Out << "static const ConstantFP80Ty FPConstant" << FPCounter++ << " = { 0x" << std::hex << ((uint16_t)p[1] | (p[0] & 0xffffffffffffLL)<<16) |
