SILGen: Refactor key path component lowering.

Factor out the code to lower an individual key path component to be independent of overall KeyPathExpr lowering, so that we can soon reuse the same code paths to build property descriptors for resilient properties. NFC intended.
This commit is contained in:
Joe Groff
2018-02-26 09:13:12 -08:00
parent dc83e87cb1
commit 2f0a3f2e2d
9 changed files with 322 additions and 223 deletions

View File

@@ -1110,14 +1110,12 @@ public:
CanType baseFormalType,
SILDeclRef accessor);
SILDeclRef getGetterDeclRef(AbstractStorageDecl *decl);
RValue emitGetAccessor(SILLocation loc, SILDeclRef getter,
SubstitutionList substitutions,
ArgumentSource &&optionalSelfValue,
bool isSuper, bool isDirectAccessorUse,
RValue &&optionalSubscripts, SGFContext C);
SILDeclRef getSetterDeclRef(AbstractStorageDecl *decl);
void emitSetAccessor(SILLocation loc, SILDeclRef setter,
SubstitutionList substitutions,
ArgumentSource &&optionalSelfValue,
@@ -1125,7 +1123,6 @@ public:
RValue &&optionalSubscripts,
ArgumentSource &&value);
SILDeclRef getMaterializeForSetDeclRef(AbstractStorageDecl *decl);
MaterializedLValue
emitMaterializeForSetAccessor(SILLocation loc, SILDeclRef materializeForSet,
SubstitutionList substitutions,
@@ -1142,8 +1139,6 @@ public:
SubstitutionList witnessSubs);
void emitMaterializeForSet(AccessorDecl *decl);
SILDeclRef getAddressorDeclRef(AbstractStorageDecl *decl,
AccessKind accessKind);
std::pair<ManagedValue,ManagedValue>
emitAddressorAccessor(SILLocation loc, SILDeclRef addressor,
SubstitutionList substitutions,