@@ -945,8 +945,8 @@ struct ConcreteArgumentCopy {
945
945
}
946
946
947
947
static Optional<ConcreteArgumentCopy>
948
- generate (const ConcreteExistentialInfo &CEI , ApplySite apply, unsigned argIdx ,
949
- SILBuilderContext &BuilderCtx ) {
948
+ generate (const ConcreteExistentialInfo &existentialInfo , ApplySite apply,
949
+ unsigned argIdx, SILBuilderContext &builderCtx ) {
950
950
SILParameterInfo paramInfo =
951
951
apply.getOrigCalleeConv ().getParamInfoForSILArg (argIdx);
952
952
// Mutation should have been checked before we get this far.
@@ -976,21 +976,23 @@ struct ConcreteArgumentCopy {
976
976
if (!paramInfo.isFormalIndirect ())
977
977
return None;
978
978
979
- SILBuilderWithScope B (apply.getInstruction (), BuilderCtx );
979
+ SILBuilderWithScope builder (apply.getInstruction (), builderCtx );
980
980
auto loc = apply.getLoc ();
981
- auto *ASI = B.createAllocStack (loc, CEI.ConcreteValue ->getType ());
981
+ auto *asi =
982
+ builder.createAllocStack (loc, existentialInfo.ConcreteValue ->getType ());
982
983
// If the type is an address, simple copy it.
983
- if (CEI .ConcreteValue ->getType ().isAddress ()) {
984
- B .createCopyAddr (loc, CEI .ConcreteValue , ASI , IsNotTake,
985
- IsInitialization_t::IsInitialization);
984
+ if (existentialInfo .ConcreteValue ->getType ().isAddress ()) {
985
+ builder .createCopyAddr (loc, existentialInfo .ConcreteValue , asi , IsNotTake,
986
+ IsInitialization_t::IsInitialization);
986
987
} else {
987
988
// Otherwise, we probably got the value from the source of a store
988
989
// instruction so, create a store into the temporary argument.
989
- B.createStrongRetain (loc, CEI.ConcreteValue , B.getDefaultAtomicity ());
990
- B.createStore (loc, CEI.ConcreteValue , ASI,
991
- StoreOwnershipQualifier::Unqualified);
990
+ auto copy =
991
+ builder.emitCopyValueOperation (loc, existentialInfo.ConcreteValue );
992
+ builder.emitStoreValueOperation (loc, copy, asi,
993
+ StoreOwnershipQualifier::Init);
992
994
}
993
- return ConcreteArgumentCopy (origArg, ASI );
995
+ return ConcreteArgumentCopy (origArg, asi );
994
996
}
995
997
};
996
998
@@ -1416,7 +1418,7 @@ static void emitMatchingRCAdjustmentsForCall(ApplyInst *Call, SILValue OnX) {
1416
1418
1417
1419
// Emit a retain for the @owned return.
1418
1420
SILBuilderWithScope Builder (Call);
1419
- Builder.createRetainValue (Call->getLoc (), OnX, Builder. getDefaultAtomicity () );
1421
+ OnX = Builder.emitCopyValueOperation (Call->getLoc (), OnX);
1420
1422
1421
1423
// Emit a release for the @owned parameter, or none for a @guaranteed
1422
1424
// parameter.
@@ -1428,7 +1430,7 @@ static void emitMatchingRCAdjustmentsForCall(ApplyInst *Call, SILValue OnX) {
1428
1430
ParamInfo == ParameterConvention::Direct_Guaranteed);
1429
1431
1430
1432
if (ParamInfo == ParameterConvention::Direct_Owned)
1431
- Builder.createReleaseValue (Call->getLoc (), OnX, Builder. getDefaultAtomicity () );
1433
+ Builder.emitDestroyValueOperation (Call->getLoc (), OnX);
1432
1434
}
1433
1435
1434
1436
// / Replace an application of a cast composition f_inverse(f(x)) by x.
0 commit comments