From: Duncan P. N. Exon Smith Date: Tue, 19 Aug 2014 00:24:26 +0000 (+0000) Subject: IR: Declare LookupKey right before its use, NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=79f9f85c04e1ed29670ed7a87df879bb5b42a0f1;p=oota-llvm.git IR: Declare LookupKey right before its use, NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215956 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp index 23845d8e3b8..45a71dc6230 100644 --- a/lib/IR/Constants.cpp +++ b/lib/IR/Constants.cpp @@ -2660,8 +2660,6 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To, LLVMContextImpl *pImpl = getType()->getContext().pImpl; SmallVector Values; - LLVMContextImpl::ArrayConstantsTy::LookupKey Lookup; - Lookup.first = cast(getType()); Values.reserve(getNumOperands()); // Build replacement array. // Fill values with the modified operands of the constant array. Also, @@ -2687,7 +2685,8 @@ void ConstantArray::replaceUsesOfWithOnConstant(Value *From, Value *To, Replacement = UndefValue::get(getType()); } else { // Check to see if we have this array type already. - Lookup.second = makeArrayRef(Values); + LLVMContextImpl::ArrayConstantsTy::LookupKey Lookup( + cast(getType()), makeArrayRef(Values)); LLVMContextImpl::ArrayConstantsTy::MapTy::iterator I = pImpl->ArrayConstants.find(Lookup); @@ -2736,8 +2735,6 @@ void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To, assert(getOperand(OperandToUpdate) == From && "ReplaceAllUsesWith broken!"); SmallVector Values; - LLVMContextImpl::StructConstantsTy::LookupKey Lookup; - Lookup.first = cast(getType()); Values.reserve(getNumOperands()); // Build replacement struct. // Fill values with the modified operands of the constant struct. Also, @@ -2773,7 +2770,8 @@ void ConstantStruct::replaceUsesOfWithOnConstant(Value *From, Value *To, Replacement = UndefValue::get(getType()); } else { // Check to see if we have this struct type already. - Lookup.second = makeArrayRef(Values); + LLVMContextImpl::StructConstantsTy::LookupKey Lookup( + cast(getType()), makeArrayRef(Values)); LLVMContextImpl::StructConstantsTy::MapTy::iterator I = pImpl->StructConstants.find(Lookup);