Add loadDynamicallyReplacedFunctionDecl

To support lazy resolution of the cross-referenced function in a serialized @_dynamicReplacement(for: ...) attribute, add a utility to the LazyMemberLoader and plumb it through.  This is a more general utility than the current resolver, which relies on the type checker to strip the attribute off of VarDecls and fan it back out onto accessors, which means serialization has only ever seen AbstractFunctionDecls.
This commit is contained in:
Robert Widmann
2019-11-22 00:53:54 -08:00
parent ee99bf1f57
commit ac08fceacc
4 changed files with 20 additions and 0 deletions

View File

@@ -5457,6 +5457,11 @@ ModuleFile::loadAssociatedTypeDefault(const swift::AssociatedTypeDecl *ATD,
return getType(contextData);
}
ValueDecl *ModuleFile::loadDynamicallyReplacedFunctionDecl(
const DynamicReplacementAttr *DRA, uint64_t contextData) {
return cast<ValueDecl>(getDecl(contextData));
}
void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
uint64_t contextData) {
using namespace decls_block;