[SILGen] Teach SILGen to emit property wrapper generator functions that

take in a projected value.
This commit is contained in:
Holly Borla
2021-02-24 19:36:01 -08:00
parent 13692fefde
commit 648c5753df
21 changed files with 176 additions and 10 deletions

View File

@@ -19,6 +19,7 @@
#include "swift/AST/CanTypeVisitor.h"
#include "swift/AST/GenericEnvironment.h"
#include "swift/AST/ParameterList.h"
#include "swift/AST/PropertyWrappers.h"
using namespace swift;
using namespace Lowering;
@@ -242,8 +243,13 @@ struct ArgumentInitHelper {
}
void emitParam(ParamDecl *PD) {
if (auto *backingVar = PD->getPropertyWrapperBackingProperty())
PD = cast<ParamDecl>(backingVar);
if (auto wrapperInfo = PD->getPropertyWrapperBackingPropertyInfo()) {
if (wrapperInfo.hasSynthesizedInitializers()) {
SGF.SGM.emitPropertyWrapperBackingInitializer(PD);
}
PD = cast<ParamDecl>(wrapperInfo.backingVar);
}
auto type = PD->getType();