[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:
Michael Gottesman
2016-11-25 00:58:49 -06:00
parent a998d98924
commit 0a8c54d04f
33 changed files with 97 additions and 132 deletions

View File

@@ -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);