@@ -3070,7 +3070,8 @@ class LLVM_LIBRARY_VISIBILITY SILGenBorrowedBaseVisitor
30703070 auto accessSemantics = e->getAccessSemantics ();
30713071 AccessStrategy strategy = var->getAccessStrategy (
30723072 accessSemantics, getFormalAccessKind (accessKind),
3073- SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion ());
3073+ SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion (),
3074+ /* useOldABI=*/ false );
30743075
30753076 auto baseFormalType = getBaseFormalType (e->getBase ());
30763077 LValue lv = visit (
@@ -3292,9 +3293,9 @@ static LValue emitLValueForNonMemberVarDecl(
32923293 subs = SGF.F .getForwardingSubstitutionMap ();
32933294
32943295 auto access = getFormalAccessKind (accessKind);
3295- auto strategy =
3296- var-> getAccessStrategy ( semantics, access, SGF.SGM .M .getSwiftModule (),
3297- SGF.F .getResilienceExpansion ());
3296+ auto strategy = var-> getAccessStrategy (
3297+ semantics, access, SGF.SGM .M .getSwiftModule (),
3298+ SGF.F .getResilienceExpansion (), /* useOldABI= */ false );
32983299
32993300 lv.addNonMemberVarComponent (SGF, loc, var, subs, options, accessKind,
33003301 strategy, formalRValueType, actorIso);
@@ -3887,6 +3888,25 @@ static bool isCurrentFunctionAccessor(SILGenFunction &SGF,
38873888 contextAccessorDecl->getAccessorKind () == accessorKind;
38883889}
38893890
3891+ static bool isSynthesizedDefaultImplementionatThunk (SILGenFunction &SGF) {
3892+ if (!SGF.FunctionDC )
3893+ return false ;
3894+
3895+ auto *decl = SGF.FunctionDC ->getAsDecl ();
3896+ if (!decl)
3897+ return false ;
3898+
3899+ auto *dc = decl->getDeclContext ();
3900+ if (!dc)
3901+ return false ;
3902+
3903+ auto *proto = dyn_cast<ProtocolDecl>(dc);
3904+ if (!proto)
3905+ return false ;
3906+
3907+ return true ;
3908+ }
3909+
38903910LValue SILGenLValue::visitMemberRefExpr (MemberRefExpr *e,
38913911 SGFAccessKind accessKind,
38923912 LValueOptions options) {
@@ -3908,11 +3928,10 @@ LValue SILGenLValue::visitMemberRefExpr(MemberRefExpr *e,
39083928 }
39093929
39103930 auto accessSemantics = e->getAccessSemantics ();
3911- AccessStrategy strategy =
3912- var->getAccessStrategy (accessSemantics,
3913- getFormalAccessKind (accessKind),
3914- SGF.SGM .M .getSwiftModule (),
3915- SGF.F .getResilienceExpansion ());
3931+ AccessStrategy strategy = var->getAccessStrategy (
3932+ accessSemantics, getFormalAccessKind (accessKind),
3933+ SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion (),
3934+ /* useOldABI=*/ isSynthesizedDefaultImplementionatThunk (SGF));
39163935
39173936 bool isOnSelfParameter = isCallToSelfOfCurrentFunction (SGF, e);
39183937
@@ -3931,10 +3950,9 @@ LValue SILGenLValue::visitMemberRefExpr(MemberRefExpr *e,
39313950 SGF, readAccessor.getAbstractFunctionDecl (), isObjC)) {
39323951 accessSemantics = AccessSemantics::DirectToImplementation;
39333952 strategy = var->getAccessStrategy (
3934- accessSemantics,
3935- getFormalAccessKind (accessKind),
3936- SGF.SGM .M .getSwiftModule (),
3937- SGF.F .getResilienceExpansion ());
3953+ accessSemantics, getFormalAccessKind (accessKind),
3954+ SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion (),
3955+ /* useOldABI=*/ false );
39383956 }
39393957 }
39403958
@@ -4119,11 +4137,10 @@ LValue SILGenLValue::visitSubscriptExpr(SubscriptExpr *e,
41194137
41204138
41214139 auto accessSemantics = e->getAccessSemantics ();
4122- auto strategy =
4123- decl->getAccessStrategy (accessSemantics,
4124- getFormalAccessKind (accessKind),
4125- SGF.SGM .M .getSwiftModule (),
4126- SGF.F .getResilienceExpansion ());
4140+ auto strategy = decl->getAccessStrategy (
4141+ accessSemantics, getFormalAccessKind (accessKind),
4142+ SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion (),
4143+ /* useOldABI=*/ isSynthesizedDefaultImplementionatThunk (SGF));
41274144
41284145 bool isOnSelfParameter = isCallToSelfOfCurrentFunction (SGF, e);
41294146 bool isContextRead = isCurrentFunctionAccessor (SGF, AccessorKind::Read);
@@ -4141,10 +4158,9 @@ LValue SILGenLValue::visitSubscriptExpr(SubscriptExpr *e,
41414158 SGF, readAccessor.getAbstractFunctionDecl (), isObjC)) {
41424159 accessSemantics = AccessSemantics::DirectToImplementation;
41434160 strategy = decl->getAccessStrategy (
4144- accessSemantics,
4145- getFormalAccessKind (accessKind),
4146- SGF.SGM .M .getSwiftModule (),
4147- SGF.F .getResilienceExpansion ());
4161+ accessSemantics, getFormalAccessKind (accessKind),
4162+ SGF.SGM .M .getSwiftModule (), SGF.F .getResilienceExpansion (),
4163+ /* useOldABI=*/ false );
41484164 }
41494165 }
41504166
@@ -4597,11 +4613,9 @@ LValue SILGenFunction::emitPropertyLValue(SILLocation loc, ManagedValue base,
45974613 auto baseType = base.getType ().getASTType ();
45984614 auto subMap = baseType->getContextSubstitutionMap (ivar->getDeclContext ());
45994615
4600- AccessStrategy strategy =
4601- ivar->getAccessStrategy (semantics,
4602- getFormalAccessKind (accessKind),
4603- SGM.M .getSwiftModule (),
4604- F.getResilienceExpansion ());
4616+ AccessStrategy strategy = ivar->getAccessStrategy (
4617+ semantics, getFormalAccessKind (accessKind), SGM.M .getSwiftModule (),
4618+ F.getResilienceExpansion (), /* useOldABI=*/ false );
46054619
46064620 auto baseAccessKind =
46074621 getBaseAccessKind (SGM, ivar, accessKind, strategy, baseFormalType,
@@ -5316,10 +5330,9 @@ RValue SILGenFunction::emitRValueForStorageLoad(
53165330 SubstitutionMap substitutions,
53175331 AccessSemantics semantics, Type propTy, SGFContext C,
53185332 bool isBaseGuaranteed) {
5319- AccessStrategy strategy =
5320- storage->getAccessStrategy (semantics, AccessKind::Read,
5321- SGM.M .getSwiftModule (),
5322- F.getResilienceExpansion ());
5333+ AccessStrategy strategy = storage->getAccessStrategy (
5334+ semantics, AccessKind::Read, SGM.M .getSwiftModule (),
5335+ F.getResilienceExpansion (), /* useOldABI=*/ false );
53235336
53245337 // If we should call an accessor of some kind, do so.
53255338 if (strategy.getKind () != AccessStrategy::Storage) {
0 commit comments