[llvm] r183075 - Move object construction into [] so the temporary can be moved.
Benjamin Kramer
benny.kra at googlemail.com
Sat Jun 1 10:51:04 PDT 2013
Author: d0k
Date: Sat Jun 1 12:51:03 2013
New Revision: 183075
URL: http://llvm.org/viewvc/llvm-project?rev=183075&view=rev
Log:
Move object construction into [] so the temporary can be moved.
No functionality change.
Modified:
llvm/trunk/lib/IR/Constants.cpp
Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=183075&r1=183074&r2=183075&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Sat Jun 1 12:51:03 2013
@@ -483,8 +483,8 @@ ConstantInt *ConstantInt::get(LLVMContex
// Get the corresponding integer type for the bit width of the value.
IntegerType *ITy = IntegerType::get(Context, V.getBitWidth());
// get an existing value or the insertion position
- DenseMapAPIntKeyInfo::KeyTy Key(V, ITy);
- ConstantInt *&Slot = Context.pImpl->IntConstants[Key];
+ LLVMContextImpl *pImpl = Context.pImpl;
+ ConstantInt *&Slot = pImpl->IntConstants[DenseMapAPIntKeyInfo::KeyTy(V, ITy)];
if (!Slot) Slot = new ConstantInt(ITy, V);
return Slot;
}
@@ -608,11 +608,9 @@ Constant *ConstantFP::getZeroValueForNeg
// ConstantFP accessors.
ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {
- DenseMapAPFloatKeyInfo::KeyTy Key(V);
-
LLVMContextImpl* pImpl = Context.pImpl;
- ConstantFP *&Slot = pImpl->FPConstants[Key];
+ ConstantFP *&Slot = pImpl->FPConstants[DenseMapAPFloatKeyInfo::KeyTy(V)];
if (!Slot) {
Type *Ty;
More information about the llvm-commits
mailing list