mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-09 09:01:25 +00:00
Move object construction into [] so the temporary can be moved.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
da8b91a073
commit
6dd56e60b0
@ -483,8 +483,8 @@ ConstantInt *ConstantInt::get(LLVMContext &Context, const APInt &V) {
|
|||||||
// Get the corresponding integer type for the bit width of the value.
|
// Get the corresponding integer type for the bit width of the value.
|
||||||
IntegerType *ITy = IntegerType::get(Context, V.getBitWidth());
|
IntegerType *ITy = IntegerType::get(Context, V.getBitWidth());
|
||||||
// get an existing value or the insertion position
|
// get an existing value or the insertion position
|
||||||
DenseMapAPIntKeyInfo::KeyTy Key(V, ITy);
|
LLVMContextImpl *pImpl = Context.pImpl;
|
||||||
ConstantInt *&Slot = Context.pImpl->IntConstants[Key];
|
ConstantInt *&Slot = pImpl->IntConstants[DenseMapAPIntKeyInfo::KeyTy(V, ITy)];
|
||||||
if (!Slot) Slot = new ConstantInt(ITy, V);
|
if (!Slot) Slot = new ConstantInt(ITy, V);
|
||||||
return Slot;
|
return Slot;
|
||||||
}
|
}
|
||||||
@ -608,11 +608,9 @@ Constant *ConstantFP::getZeroValueForNegation(Type *Ty) {
|
|||||||
|
|
||||||
// ConstantFP accessors.
|
// ConstantFP accessors.
|
||||||
ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {
|
ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {
|
||||||
DenseMapAPFloatKeyInfo::KeyTy Key(V);
|
|
||||||
|
|
||||||
LLVMContextImpl* pImpl = Context.pImpl;
|
LLVMContextImpl* pImpl = Context.pImpl;
|
||||||
|
|
||||||
ConstantFP *&Slot = pImpl->FPConstants[Key];
|
ConstantFP *&Slot = pImpl->FPConstants[DenseMapAPFloatKeyInfo::KeyTy(V)];
|
||||||
|
|
||||||
if (!Slot) {
|
if (!Slot) {
|
||||||
Type *Ty;
|
Type *Ty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user