avoid an APFloat copy.
authorChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2007 05:34:10 +0000 (05:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2007 05:34:10 +0000 (05:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/ConstantFold.cpp

index 485b42863b2a346fda530e416b5513c8d588469c..da7e768d72087ca340fbb7b089e8ed6ba0c3cd59 100644 (file)
@@ -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,