Skip to content

Commit 0a8c54d

Browse files
committed
[gardening] Always create new SILArguments using SILBasicBlock::createArgument instead of inline placement new.
The reasoning here is the same as in e42bf07.
1 parent a998d98 commit 0a8c54d

33 files changed

+97
-132
lines changed

include/swift/SIL/SILArgument.h

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,8 @@ class SILArgument : public ValueBase {
117117

118118
SILBasicBlock *ParentBB;
119119
const ValueDecl *Decl;
120-
public:
121-
SILArgument(SILBasicBlock *ParentBB, SILType Ty, const ValueDecl *D=nullptr);
122-
SILArgument(SILBasicBlock *ParentBB, SILBasicBlock::arg_iterator Pos,
123-
SILType Ty, const ValueDecl *D = nullptr);
124-
125-
SILArgument(SILFunction::iterator ParentBB, SILType Ty,
126-
const ValueDecl *D = nullptr)
127-
: SILArgument(&*ParentBB, Ty, D) {}
128-
SILArgument(SILFunction::iterator ParentBB, SILBasicBlock::arg_iterator Pos,
129-
SILType Ty, const ValueDecl *D = nullptr)
130-
: SILArgument(&*ParentBB, Pos, Ty, D) {}
131120

121+
public:
132122
SILBasicBlock *getParent() { return ParentBB; }
133123
const SILBasicBlock *getParent() const { return ParentBB; }
134124

@@ -230,10 +220,16 @@ class SILArgument : public ValueBase {
230220
}
231221

232222
private:
223+
friend class SILBasicBlock;
224+
225+
SILArgument(SILBasicBlock *ParentBB, SILType Ty,
226+
const ValueDecl *D = nullptr);
227+
SILArgument(SILBasicBlock *ParentBB, SILBasicBlock::arg_iterator Pos,
228+
SILType Ty, const ValueDecl *D = nullptr);
229+
233230
// A special constructor, only intended for use in SILBasicBlock::replaceBBArg.
234231
explicit SILArgument(SILType Ty, const ValueDecl *D =nullptr) :
235232
ValueBase(ValueKind::SILArgument, Ty), ParentBB(nullptr), Decl(D) {}
236-
friend class SILBasicBlock;
237233
void setParent(SILBasicBlock *P) { ParentBB = P; }
238234
};
239235

include/swift/SIL/SILCloner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ SILCloner<ImplClass>::visitSILBasicBlock(SILBasicBlock* BB) {
402402
// Create new arguments for each of the original block's arguments.
403403
for (auto &Arg : Succ.getBB()->getArguments()) {
404404
SILValue MappedArg =
405-
new (F.getModule()) SILArgument(MappedBB, getOpType(Arg->getType()));
405+
MappedBB->createArgument(getOpType(Arg->getType()));
406406

407407
ValueMap.insert(std::make_pair(Arg, MappedArg));
408408
}

lib/Parse/ParseSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3957,7 +3957,7 @@ bool SILParser::parseSILBasicBlock(SILBuilder &B) {
39573957
P.parseToken(tok::colon, diag::expected_sil_colon_value_ref) ||
39583958
parseSILType(Ty))
39593959
return true;
3960-
auto Arg = new (SILMod) SILArgument(BB, Ty);
3960+
auto Arg = BB->createArgument(Ty);
39613961
setLocalValue(Arg, Name, NameLoc);
39623962
} while (P.consumeIf(tok::comma));
39633963

lib/SIL/DynamicCasts.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ namespace {
930930
CastConsumptionKind::TakeAlways);
931931
} else {
932932
SILValue sourceObjectValue =
933-
new (M) SILArgument(someBB, loweredSourceObjectType);
933+
someBB->createArgument(loweredSourceObjectType);
934934
objectSource = Source(sourceObjectValue, sourceObjectType,
935935
source.Consumption);
936936
}
@@ -968,7 +968,7 @@ namespace {
968968
if (target.isAddress()) {
969969
return target.asAddressSource();
970970
} else {
971-
SILValue result = new (M) SILArgument(contBB, target.LoweredType);
971+
SILValue result = contBB->createArgument(target.LoweredType);
972972
return target.asScalarSource(result);
973973
}
974974
}
@@ -1214,8 +1214,7 @@ emitIndirectConditionalCastWithScalar(SILBuilder &B, Module *M,
12141214
// Emit the success block.
12151215
B.setInsertionPoint(scalarSuccBB); {
12161216
auto &targetTL = B.getModule().Types.getTypeLowering(targetValueType);
1217-
SILValue succValue =
1218-
new (B.getModule()) SILArgument(scalarSuccBB, targetValueType);
1217+
SILValue succValue = scalarSuccBB->createArgument(targetValueType);
12191218
if (!shouldTakeOnSuccess(consumption))
12201219
targetTL.emitCopyValue(B, loc, succValue);
12211220
targetTL.emitStoreOfCopy(B, loc, succValue, dest, IsInitialization);

lib/SILGen/Condition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ ConditionalValue::ConditionalValue(SILGenFunction &gen, SGFContext C,
155155
} else {
156156
// Otherwise, add a BB arg to the continuation block to receive loadable
157157
// result.
158-
result = new (gen.F.getModule()) SILArgument(contBB, tl.getLoweredType());
158+
result = contBB->createArgument(tl.getLoweredType());
159159
}
160160
}
161161

lib/SILGen/RValue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ class EmitBBArguments : public CanTypeVisitor<EmitBBArguments,
254254
: gen(gen), parent(parent), loc(l), functionArgs(functionArgs) {}
255255

256256
RValue visitType(CanType t) {
257-
SILValue arg = new (gen.SGM.M)
258-
SILArgument(parent, gen.getLoweredType(t), loc.getAsASTNode<ValueDecl>());
257+
SILValue arg = parent->createArgument(gen.getLoweredType(t),
258+
loc.getAsASTNode<ValueDecl>());
259259
ManagedValue mv = isa<InOutType>(t)
260260
? ManagedValue::forLValue(arg)
261261
: gen.emitManagedRValueWithCleanup(arg);

lib/SILGen/SILGen.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,10 +1230,8 @@ static void emitTopLevelProlog(SILGenFunction &gen, SILLocation loc) {
12301230
// Create the argc and argv arguments.
12311231
auto &C = gen.getASTContext();
12321232
auto FnTy = gen.F.getLoweredFunctionType();
1233-
auto argc = new (gen.F.getModule()) SILArgument(
1234-
entry, FnTy->getParameters()[0].getSILType());
1235-
auto argv = new (gen.F.getModule()) SILArgument(
1236-
entry, FnTy->getParameters()[1].getSILType());
1233+
auto *argc = entry->createArgument(FnTy->getParameters()[0].getSILType());
1234+
auto *argv = entry->createArgument(FnTy->getParameters()[1].getSILType());
12371235

12381236
// If the standard library provides a _stdlib_didEnterMain intrinsic, call it
12391237
// first thing.

lib/SILGen/SILGenApply.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5541,8 +5541,7 @@ RValue SILGenFunction::emitDynamicMemberRefExpr(DynamicMemberRefExpr *e,
55415541
auto dynamicMethodTy = getDynamicMethodLoweredType(*this, operand, member,
55425542
memberFnTy);
55435543
auto loweredMethodTy = SILType::getPrimitiveObjectType(dynamicMethodTy);
5544-
SILValue memberArg = new (F.getModule()) SILArgument(hasMemberBB,
5545-
loweredMethodTy);
5544+
SILValue memberArg = hasMemberBB->createArgument(loweredMethodTy);
55465545

55475546
// Create the result value.
55485547
SILValue result = emitDynamicPartialApply(*this, e, memberArg, operand,
@@ -5637,8 +5636,7 @@ RValue SILGenFunction::emitDynamicSubscriptExpr(DynamicSubscriptExpr *e,
56375636
auto dynamicMethodTy = getDynamicMethodLoweredType(*this, base, member,
56385637
functionTy);
56395638
auto loweredMethodTy = SILType::getPrimitiveObjectType(dynamicMethodTy);
5640-
SILValue memberArg = new (F.getModule()) SILArgument(hasMemberBB,
5641-
loweredMethodTy);
5639+
SILValue memberArg = hasMemberBB->createArgument(loweredMethodTy);
56425640
// Emit the application of 'self'.
56435641
SILValue result = emitDynamicPartialApply(*this, e, memberArg, base,
56445642
cast<FunctionType>(methodTy));

lib/SILGen/SILGenBridging.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static void buildFuncToBlockInvokeBody(SILGenFunction &gen,
244244

245245
// Get the captured native function value out of the block.
246246
auto storageAddrTy = SILType::getPrimitiveAddressType(blockStorageTy);
247-
auto storage = new (gen.SGM.M) SILArgument(entry, storageAddrTy);
247+
auto storage = entry->createArgument(storageAddrTy);
248248
auto capture = gen.B.createProjectBlockStorage(loc, storage);
249249
auto &funcTL = gen.getTypeLowering(funcTy);
250250
auto fn = gen.emitLoad(loc, capture, funcTL, SGFContext(), IsNotTake);
@@ -258,7 +258,7 @@ static void buildFuncToBlockInvokeBody(SILGenFunction &gen,
258258
for (unsigned i : indices(funcTy->getParameters())) {
259259
auto &funcParam = funcTy->getParameters()[i];
260260
auto &param = blockTy->getParameters()[i];
261-
SILValue v = new (gen.SGM.M) SILArgument(entry, param.getSILType());
261+
SILValue v = entry->createArgument(param.getSILType());
262262

263263
ManagedValue mv;
264264

@@ -603,7 +603,7 @@ static void buildBlockToFuncThunkBody(SILGenFunction &gen,
603603
if (tl.isAddressOnly()) {
604604
assert(result.getConvention() == ResultConvention::Indirect);
605605

606-
indirectResult = new (gen.SGM.M) SILArgument(entry, result.getSILType());
606+
indirectResult = entry->createArgument(result.getSILType());
607607
}
608608
}
609609

@@ -612,17 +612,16 @@ static void buildBlockToFuncThunkBody(SILGenFunction &gen,
612612
auto &blockParam = blockTy->getParameters()[i];
613613

614614
auto &tl = gen.getTypeLowering(param.getSILType());
615-
SILValue v = new (gen.SGM.M) SILArgument(entry, param.getSILType());
615+
SILValue v = entry->createArgument(param.getSILType());
616616
auto mv = gen.emitManagedRValueWithCleanup(v, tl);
617617
args.push_back(gen.emitNativeToBridgedValue(loc, mv,
618618
SILFunctionTypeRepresentation::Block,
619619
blockParam.getType()));
620620
}
621621

622622
// Add the block argument.
623-
SILValue blockV
624-
= new (gen.SGM.M) SILArgument(entry,
625-
SILType::getPrimitiveObjectType(blockTy));
623+
SILValue blockV =
624+
entry->createArgument(SILType::getPrimitiveObjectType(blockTy));
626625
ManagedValue block = gen.emitManagedRValueWithCleanup(blockV);
627626

628627
// Call the block.
@@ -928,7 +927,7 @@ static SILFunctionType *emitObjCThunkArguments(SILGenFunction &gen,
928927
nativeInputs.size() + unsigned(foreignError.hasValue()));
929928
for (unsigned i = 0, e = inputs.size(); i < e; ++i) {
930929
SILType argTy = inputs[i].getSILType();
931-
SILValue arg = new(gen.F.getModule()) SILArgument(gen.F.begin(), argTy);
930+
SILValue arg = gen.F.begin()->createArgument(argTy);
932931

933932
// If this parameter is the foreign error slot, pull it out.
934933
// It does not correspond to a native argument.
@@ -1204,8 +1203,8 @@ void SILGenFunction::emitForeignToNativeThunk(SILDeclRef thunk) {
12041203
if (!nativeFnTy->getIndirectResults().empty()) {
12051204
assert(nativeFnTy->getIndirectResults().size() == 1
12061205
&& "bridged exploded result?!");
1207-
indirectResult = new (F.getModule()) SILArgument(F.begin(),
1208-
nativeFnTy->getIndirectResults()[0].getSILType());
1206+
indirectResult = F.begin()->createArgument(
1207+
nativeFnTy->getIndirectResults()[0].getSILType());
12091208
}
12101209

12111210
for (auto *paramList : reversed(forwardedParameters))
@@ -1214,10 +1213,8 @@ void SILGenFunction::emitForeignToNativeThunk(SILDeclRef thunk) {
12141213
if (allocatorSelfType) {
12151214
auto selfMetatype =
12161215
CanMetatypeType::get(allocatorSelfType->getCanonicalType());
1217-
auto selfArg = new (F.getModule()) SILArgument(
1218-
F.begin(),
1219-
getLoweredLoadableType(selfMetatype),
1220-
fd->getImplicitSelfDecl());
1216+
auto selfArg = F.begin()->createArgument(
1217+
getLoweredLoadableType(selfMetatype), fd->getImplicitSelfDecl());
12211218
params.push_back(selfArg);
12221219
}
12231220

lib/SILGen/SILGenConstructor.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ static SILValue emitConstructorMetatypeArg(SILGenFunction &gen,
3838
AC.getIdentifier("$metatype"), SourceLoc(),
3939
AC.getIdentifier("$metatype"), metatype,
4040
ctor->getDeclContext());
41-
gen.AllocatorMetatype = new (gen.F.getModule()) SILArgument(gen.F.begin(),
42-
gen.getLoweredType(metatype), VD);
41+
gen.AllocatorMetatype =
42+
gen.F.begin()->createArgument(gen.getLoweredType(metatype), VD);
4343
return gen.AllocatorMetatype;
4444
}
4545

@@ -60,9 +60,7 @@ static RValue emitImplicitValueConstructorArg(SILGenFunction &gen,
6060
AC.getIdentifier("$implicit_value"),
6161
SourceLoc(),
6262
AC.getIdentifier("$implicit_value"), ty, DC);
63-
SILValue arg = new (gen.F.getModule()) SILArgument(gen.F.begin(),
64-
gen.getLoweredType(ty),
65-
VD);
63+
SILValue arg = gen.F.begin()->createArgument(gen.getLoweredType(ty), VD);
6664
return RValue(gen, loc, ty, gen.emitManagedRValueWithCleanup(arg));
6765
}
6866
}
@@ -85,7 +83,7 @@ static void emitImplicitValueConstructor(SILGenFunction &gen,
8583
SourceLoc(),
8684
AC.getIdentifier("$return_value"), selfTyCan,
8785
ctor);
88-
resultSlot = new (gen.F.getModule()) SILArgument(gen.F.begin(), selfTy, VD);
86+
resultSlot = gen.F.begin()->createArgument(selfTy, VD);
8987
}
9088

9189
// Emit the elementwise arguments.
@@ -237,8 +235,8 @@ void SILGenFunction::emitValueConstructor(ConstructorDecl *ctor) {
237235
B.createReturn(ctor, emitEmptyTuple(ctor));
238236
} else {
239237
// Pass 'nil' as the return value to the exit BB.
240-
failureExitArg = new (F.getModule())
241-
SILArgument(failureExitBB, resultLowering.getLoweredType());
238+
failureExitArg =
239+
failureExitBB->createArgument(resultLowering.getLoweredType());
242240
SILValue nilResult =
243241
B.createEnum(ctor, {}, getASTContext().getOptionalNoneDecl(),
244242
resultLowering.getLoweredType());
@@ -365,9 +363,7 @@ void SILGenFunction::emitEnumConstructor(EnumElementDecl *element) {
365363
AC.getIdentifier("$return_value"),
366364
CanInOutType::get(enumTy),
367365
element->getDeclContext());
368-
auto resultSlot = new (SGM.M) SILArgument(F.begin(),
369-
enumTI.getLoweredType(),
370-
VD);
366+
auto resultSlot = F.begin()->createArgument(enumTI.getLoweredType(), VD);
371367
dest = std::unique_ptr<Initialization>(
372368
new KnownAddressInitialization(resultSlot));
373369
}
@@ -563,7 +559,7 @@ void SILGenFunction::emitClassConstructorInitializer(ConstructorDecl *ctor) {
563559
TupleType::getEmpty(F.getASTContext()), ctor, ctor->hasThrows());
564560

565561
SILType selfTy = getLoweredLoadableType(selfDecl->getType());
566-
SILValue selfArg = new (SGM.M) SILArgument(F.begin(), selfTy, selfDecl);
562+
SILValue selfArg = F.begin()->createArgument(selfTy, selfDecl);
567563

568564
if (!NeedsBoxForSelf) {
569565
SILLocation PrologueLoc(selfDecl);
@@ -612,8 +608,8 @@ void SILGenFunction::emitClassConstructorInitializer(ConstructorDecl *ctor) {
612608
SavedInsertionPoint savedIP(*this, failureBB, FunctionSection::Postmatter);
613609

614610
failureExitBB = createBasicBlock();
615-
failureExitArg = new (F.getModule())
616-
SILArgument(failureExitBB, resultLowering.getLoweredType());
611+
failureExitArg =
612+
failureExitBB->createArgument(resultLowering.getLoweredType());
617613

618614
Cleanups.emitCleanupsForReturn(ctor);
619615
SILValue nilResult = B.createEnum(loc, {},
@@ -942,7 +938,7 @@ void SILGenFunction::emitIVarInitializer(SILDeclRef ivarInitializer) {
942938
// Emit 'self', then mark it uninitialized.
943939
auto selfDecl = cd->getDestructor()->getImplicitSelfDecl();
944940
SILType selfTy = getLoweredLoadableType(selfDecl->getType());
945-
SILValue selfArg = new (SGM.M) SILArgument(F.begin(), selfTy, selfDecl);
941+
SILValue selfArg = F.begin()->createArgument(selfTy, selfDecl);
946942
SILLocation PrologueLoc(selfDecl);
947943
PrologueLoc.markAsPrologue();
948944
B.createDebugValue(PrologueLoc, selfArg);

lib/SILGen/SILGenConvert.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,8 @@ SILGenFunction::emitOptionalToOptional(SILLocation loc,
281281
if (resultTL.isAddressOnly())
282282
result = emitTemporaryAllocation(loc, resultTy);
283283
else
284-
result = new (F.getModule()) SILArgument(contBB, resultTL.getLoweredType());
284+
result = contBB->createArgument(resultTL.getLoweredType());
285285

286-
287286
// Branch on whether the input is optional, this doesn't consume the value.
288287
auto isPresent = emitDoesOptionalHaveValue(loc, input.getValue());
289288
B.createCondBranch(loc, isPresent, isPresentBB, isNotPresentBB);

lib/SILGen/SILGenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ emitEnumMatch(ManagedValue value, EnumElementDecl *ElementDecl,
697697
// is not address-only.
698698
SILValue eltValue;
699699
if (!value.getType().isAddress())
700-
eltValue = new (SGF.F.getModule()) SILArgument(contBB, eltTy);
700+
eltValue = contBB->createArgument(eltTy);
701701

702702
if (subInit == nullptr) {
703703
// If there is no subinitialization, then we are done matching. Don't

lib/SILGen/SILGenDynamicCast.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ namespace {
158158
result = finishFromResultBuffer(hasAbstraction, resultBuffer,
159159
abstraction, origTargetTL, ctx);
160160
} else {
161-
SILValue argument = new (SGF.F.getModule())
162-
SILArgument(trueBB, origTargetTL.getLoweredType());
161+
SILValue argument =
162+
trueBB->createArgument(origTargetTL.getLoweredType());
163163
result = finishFromResultScalar(hasAbstraction, argument, consumption,
164164
abstraction, origTargetTL, ctx);
165165
}
@@ -499,8 +499,7 @@ RValue Lowering::emitConditionalCheckedCast(SILGenFunction &SGF,
499499
if (resultObjectTemp) {
500500
result = SGF.manageBufferForExprResult(resultBuffer, resultTL, C);
501501
} else {
502-
auto argument =
503-
new (SGF.F.getModule()) SILArgument(contBB, resultTL.getLoweredType());
502+
auto argument = contBB->createArgument(resultTL.getLoweredType());
504503
result = SGF.emitManagedRValueWithCleanup(argument, resultTL);
505504
}
506505

@@ -549,7 +548,7 @@ SILValue Lowering::emitIsa(SILGenFunction &SGF, SILLocation loc,
549548
});
550549

551550
auto contBB = scope.exit();
552-
auto isa = new (SGF.SGM.M) SILArgument(contBB, i1Ty);
551+
auto isa = contBB->createArgument(i1Ty);
553552
return isa;
554553
}
555554

lib/SILGen/SILGenEpilog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void SILGenFunction::prepareEpilog(Type resultType, bool isThrowing,
2828
NeedsReturn = (F.getLoweredFunctionType()->getNumAllResults() != 0);
2929
for (auto directResult : F.getLoweredFunctionType()->getDirectResults()) {
3030
SILType resultType = F.mapTypeIntoContext(directResult.getSILType());
31-
new (F.getModule()) SILArgument(epilogBB, resultType);
31+
epilogBB->createArgument(resultType);
3232
}
3333
}
3434

@@ -42,7 +42,7 @@ void SILGenFunction::prepareEpilog(Type resultType, bool isThrowing,
4242
void SILGenFunction::prepareRethrowEpilog(CleanupLocation cleanupLoc) {
4343
auto exnType = SILType::getExceptionType(getASTContext());
4444
SILBasicBlock *rethrowBB = createBasicBlock(FunctionSection::Postmatter);
45-
new (F.getModule()) SILArgument(rethrowBB, exnType);
45+
rethrowBB->createArgument(exnType);
4646
ThrowDest = JumpDest(rethrowBB, getCleanupsDepth(), cleanupLoc);
4747
}
4848

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,7 @@ RValue RValueEmitter::visitOptionalEvaluationExpr(OptionalEvaluationExpr *E,
30403040
// If this was done in SSA registers, then the value is provided as an
30413041
// argument to the block.
30423042
if (!isByAddress) {
3043-
auto arg = new (SGF.SGM.M) SILArgument(contBB, optTL.getLoweredType());
3043+
auto arg = contBB->createArgument(optTL.getLoweredType());
30443044
return RValue(SGF, E, SGF.emitManagedRValueWithCleanup(arg, optTL));
30453045
}
30463046

lib/SILGen/SILGenFunction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ static void forwardCaptureArgs(SILGenFunction &gen,
690690
SmallVectorImpl<SILValue> &args,
691691
CapturedValue capture) {
692692
auto addSILArgument = [&](SILType t, ValueDecl *d) {
693-
args.push_back(new (gen.SGM.M) SILArgument(gen.F.begin(), t, d));
693+
args.push_back(gen.F.begin()->createArgument(t, d));
694694
};
695695

696696
auto *vd = capture.getDecl();
@@ -786,8 +786,8 @@ void SILGenFunction::emitCurryThunk(ValueDecl *vd,
786786
&& "currying constructor at level other than one?!");
787787
F.setBare(IsBare);
788788
auto selfMetaTy = vd->getType()->getAs<AnyFunctionType>()->getInput();
789-
auto metatypeVal = new (F.getModule()) SILArgument(F.begin(),
790-
getLoweredLoadableType(selfMetaTy));
789+
auto metatypeVal =
790+
F.begin()->createArgument(getLoweredLoadableType(selfMetaTy));
791791
curriedArgs.push_back(metatypeVal);
792792

793793
} else if (auto fd = dyn_cast<AbstractFunctionDecl>(vd)) {

0 commit comments

Comments
 (0)