From: Chris Lattner Date: Mon, 15 Oct 2007 05:34:10 +0000 (+0000) Subject: avoid an APFloat copy. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3cab1c72b54cceaf2a4275dabf1b4160765820fc;p=oota-llvm.git avoid an APFloat copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42979 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 485b42863b2..da7e768d720 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(V)) { - APFloat V = FPC->getValueAPF(); + const APFloat &V = FPC->getValueAPF(); uint64_t x[2]; uint32_t DestBitWidth = cast(DestTy)->getBitWidth(); (void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI,