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 | 34aa41c475f1a039300435e257a3bc182336955c (patch) | |
| tree | 9b6e03825b4d7835db4d60641f3197c1744e15bf /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
| parent | 43b66447f4e27334d14e9da76e787b59b621db9c (diff) | |
Make temporaries explicit to avoid premature
destruction of compiler-created ones.
llvm-svn: 42383
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index fdaa9be5bb61..7999907c1856 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/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) { |
