aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-15 05:34:10 +0000
committerChris Lattner <sabre@nondot.org>2007-10-15 05:34:10 +0000
commit3cab1c72b54cceaf2a4275dabf1b4160765820fc (patch)
tree57992ec6af7c917a418245a5566a5a814f8b0849 /lib/VMCore/ConstantFold.cpp
parent59afba0fe997c9f65abd66a4c3902ee2064abc4b (diff)
downloadexternal_llvm-3cab1c72b54cceaf2a4275dabf1b4160765820fc.zip
external_llvm-3cab1c72b54cceaf2a4275dabf1b4160765820fc.tar.gz
external_llvm-3cab1c72b54cceaf2a4275dabf1b4160765820fc.tar.bz2
avoid an APFloat copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 485b428..da7e768 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -194,7 +194,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
case Instruction::FPToUI:
case Instruction::FPToSI:
if (const ConstantFP *FPC = dyn_cast<ConstantFP>(V)) {
- APFloat V = FPC->getValueAPF();
+ const APFloat &V = FPC->getValueAPF();
uint64_t x[2];
uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
(void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI,