mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[gardening] Always create new SILArguments using SILBasicBlock::createArgument instead of inline placement new.
The reasoning here is the same as in e42bf07.
This commit is contained in:
@@ -585,7 +585,6 @@ PromotedParamCloner::initCloned(SILFunction *Orig, IsFragile_t Fragile,
|
||||
void
|
||||
PromotedParamCloner::populateCloned() {
|
||||
SILFunction *Cloned = getCloned();
|
||||
SILModule &M = Cloned->getModule();
|
||||
|
||||
// Create arguments for the entry block
|
||||
SILBasicBlock *OrigEntryBB = &*Orig->begin();
|
||||
@@ -597,8 +596,8 @@ PromotedParamCloner::populateCloned() {
|
||||
// Create a new argument with the promoted type.
|
||||
auto promotedTy = (*I)->getType().castTo<SILBoxType>()
|
||||
->getBoxedAddressType();
|
||||
auto promotedArg = new (M)
|
||||
SILArgument(ClonedEntryBB, promotedTy, (*I)->getDecl());
|
||||
auto *promotedArg =
|
||||
ClonedEntryBB->createArgument(promotedTy, (*I)->getDecl());
|
||||
PromotedParameters.insert(*I);
|
||||
|
||||
// Map any projections of the box to the promoted argument.
|
||||
@@ -611,7 +610,7 @@ PromotedParamCloner::populateCloned() {
|
||||
} else {
|
||||
// Create a new argument which copies the original argument.
|
||||
SILValue MappedValue =
|
||||
new (M) SILArgument(ClonedEntryBB, (*I)->getType(), (*I)->getDecl());
|
||||
ClonedEntryBB->createArgument((*I)->getType(), (*I)->getDecl());
|
||||
ValueMap.insert(std::make_pair(*I, MappedValue));
|
||||
}
|
||||
++ArgNo;
|
||||
|
||||
Reference in New Issue
Block a user