@@ -2286,15 +2286,16 @@ namespace {
22862286namespace {
22872287
22882288// / A physical component which involves calling borrow accessors.
2289- class BorrowAccessorComponent
2289+ class BorrowMutateAccessorComponent
22902290 : public AccessorBasedComponent<PhysicalPathComponent> {
22912291public:
2292- BorrowAccessorComponent (AbstractStorageDecl *decl, SILDeclRef accessor,
2293- bool isSuper, bool isDirectAccessorUse,
2294- SubstitutionMap substitutions, CanType baseFormalType,
2295- LValueTypeData typeData,
2296- ArgumentList *argListForDiagnostics,
2297- PreparedArguments &&indices, bool isOnSelfParameter)
2292+ BorrowMutateAccessorComponent (AbstractStorageDecl *decl, SILDeclRef accessor,
2293+ bool isSuper, bool isDirectAccessorUse,
2294+ SubstitutionMap substitutions,
2295+ CanType baseFormalType, LValueTypeData typeData,
2296+ ArgumentList *argListForDiagnostics,
2297+ PreparedArguments &&indices,
2298+ bool isOnSelfParameter)
22982299 : AccessorBasedComponent(BorrowMutateKind, decl, accessor, isSuper,
22992300 isDirectAccessorUse, substitutions,
23002301 baseFormalType, typeData, argListForDiagnostics,
@@ -2311,14 +2312,14 @@ class BorrowAccessorComponent
23112312 ManagedValue result;
23122313
23132314 auto args = std::move (*this ).prepareAccessorArgs (SGF, loc, base, Accessor);
2314- auto value = SGF.emitBorrowAccessor (
2315+ auto value = SGF.emitBorrowMutateAccessor (
23152316 loc, Accessor, Substitutions, std::move (args.base ), IsSuper,
23162317 IsDirectAccessorUse, std::move (args.Indices ), IsOnSelfParameter);
23172318 return value;
23182319 }
23192320
23202321 void dump (raw_ostream &OS, unsigned indent) const override {
2321- printBase (OS, indent, " BorrowAccessorComponent " );
2322+ printBase (OS, indent, " BorrowMutateAccessorComponent " );
23222323 }
23232324};
23242325} // namespace
@@ -3427,16 +3428,15 @@ namespace {
34273428 AccessKind, FormalRValueType);
34283429 return asImpl ().emitUsingInitAccessor (accessor, isDirect, typeData);
34293430 }
3430- case AccessorKind::Borrow: {
3431+ case AccessorKind::Borrow:
3432+ case AccessorKind::Mutate: {
34313433 auto typeData = getPhysicalStorageTypeData (
34323434 SGF.getTypeExpansionContext (), SGF.SGM , AccessKind, Storage, Subs,
34333435 FormalRValueType);
3434- return asImpl ().emitUsingBorrowAccessor (accessor, isDirect, typeData);
3436+ return asImpl ().emitUsingBorrowMutateAccessor (accessor, isDirect,
3437+ typeData);
34353438 }
3436- case AccessorKind::Mutate:
3437- llvm_unreachable (" mutate accessor is not yet implemented" );
34383439 }
3439-
34403440 llvm_unreachable (" bad kind" );
34413441 }
34423442 };
@@ -3526,9 +3526,9 @@ void LValue::addNonMemberVarComponent(
35263526 PreparedArguments (), /* isOnSelfParameter*/ false );
35273527 }
35283528
3529- void emitUsingBorrowAccessor (SILDeclRef accessor, bool isDirect,
3530- LValueTypeData typeData) {
3531- llvm_unreachable (" borrow accessor is not implemented" );
3529+ void emitUsingBorrowMutateAccessor (SILDeclRef accessor, bool isDirect,
3530+ LValueTypeData typeData) {
3531+ llvm_unreachable (" borrow/mutate accessor is not implemented" );
35323532 }
35333533
35343534 void emitUsingGetterSetter (SILDeclRef accessor,
@@ -4211,10 +4211,10 @@ struct MemberStorageAccessEmitter : AccessEmitter<Impl, StorageType> {
42114211 ArgListForDiagnostics, std::move (Indices), IsOnSelfParameter);
42124212 }
42134213
4214- void emitUsingBorrowAccessor (SILDeclRef accessor, bool isDirect,
4215- LValueTypeData typeData) {
4214+ void emitUsingBorrowMutateAccessor (SILDeclRef accessor, bool isDirect,
4215+ LValueTypeData typeData) {
42164216 assert (!ActorIso);
4217- LV.add <BorrowAccessorComponent >(
4217+ LV.add <BorrowMutateAccessorComponent >(
42184218 Storage, accessor, IsSuper, isDirect, Subs, BaseFormalType, typeData,
42194219 ArgListForDiagnostics, std::move (Indices), IsOnSelfParameter);
42204220 }
0 commit comments