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
commitf08f0f287cb26215bde8744680b57174d4184fed (patch)
tree57992ec6af7c917a418245a5566a5a814f8b0849 /lib/VMCore/ConstantFold.cpp
parent7271a2d49ee103d63154bc87d5b921213d50cd0b (diff)
downloadexternal_llvm-f08f0f287cb26215bde8744680b57174d4184fed.tar.gz
external_llvm-f08f0f287cb26215bde8744680b57174d4184fed.tar.bz2
external_llvm-f08f0f287cb26215bde8744680b57174d4184fed.zip
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 485b42863b..da7e768d72 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,