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:
@@ -930,7 +930,7 @@ namespace {
|
||||
CastConsumptionKind::TakeAlways);
|
||||
} else {
|
||||
SILValue sourceObjectValue =
|
||||
new (M) SILArgument(someBB, loweredSourceObjectType);
|
||||
someBB->createArgument(loweredSourceObjectType);
|
||||
objectSource = Source(sourceObjectValue, sourceObjectType,
|
||||
source.Consumption);
|
||||
}
|
||||
@@ -968,7 +968,7 @@ namespace {
|
||||
if (target.isAddress()) {
|
||||
return target.asAddressSource();
|
||||
} else {
|
||||
SILValue result = new (M) SILArgument(contBB, target.LoweredType);
|
||||
SILValue result = contBB->createArgument(target.LoweredType);
|
||||
return target.asScalarSource(result);
|
||||
}
|
||||
}
|
||||
@@ -1214,8 +1214,7 @@ emitIndirectConditionalCastWithScalar(SILBuilder &B, Module *M,
|
||||
// Emit the success block.
|
||||
B.setInsertionPoint(scalarSuccBB); {
|
||||
auto &targetTL = B.getModule().Types.getTypeLowering(targetValueType);
|
||||
SILValue succValue =
|
||||
new (B.getModule()) SILArgument(scalarSuccBB, targetValueType);
|
||||
SILValue succValue = scalarSuccBB->createArgument(targetValueType);
|
||||
if (!shouldTakeOnSuccess(consumption))
|
||||
targetTL.emitCopyValue(B, loc, succValue);
|
||||
targetTL.emitStoreOfCopy(B, loc, succValue, dest, IsInitialization);
|
||||
|
||||
Reference in New Issue
Block a user