@@ -944,22 +944,10 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
944
944
945
945
auto *pbd = var->getParentPatternBinding ();
946
946
unsigned idx = pbd->getPatternEntryIndexForVarDecl (var);
947
- auto *init = pbd->getInit (idx);
948
947
auto *initDC = pbd->getInitContext (idx);
949
948
auto captureInfo = pbd->getCaptureInfo (idx);
950
- assert (!pbd->isInitializerSubsumed (idx));
951
-
952
- // If this is the backing storage for a property with an attached wrapper
953
- // that was initialized with `=`, use that expression as the initializer.
954
- if (auto originalProperty = var->getOriginalWrappedProperty ()) {
955
- if (originalProperty
956
- ->isPropertyMemberwiseInitializedWithWrappedType ()) {
957
- auto wrapperInfo =
958
- originalProperty->getPropertyWrapperInitializerInfo ();
959
- assert (wrapperInfo.getWrappedValuePlaceholder ()->getOriginalWrappedValue ());
960
- init = wrapperInfo.getWrappedValuePlaceholder ()->getOriginalWrappedValue ();
961
- }
962
- }
949
+ auto *init = constant.getInitializationExpr ();
950
+ assert (init);
963
951
964
952
auto loc = RegularLocation::getAutoGeneratedLocation (init);
965
953
preEmitFunction (constant, f, loc);
@@ -989,13 +977,14 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
989
977
preEmitFunction (constant, f, loc);
990
978
PrettyStackTraceSILFunction X (
991
979
" silgen emitPropertyWrapperBackingInitializer" , f);
992
- auto wrapperInfo = var->getPropertyWrapperInitializerInfo ();
993
- assert (wrapperInfo.hasInitFromWrappedValue ());
994
- f->createProfiler (wrapperInfo.getInitFromWrappedValue (), constant);
980
+
981
+ auto *init = constant.getInitializationExpr ();
982
+ assert (init);
983
+
984
+ f->createProfiler (init, constant);
995
985
auto varDC = var->getInnermostDeclContext ();
996
986
SILGenFunction SGF (*this , *f, varDC);
997
- SGF.emitGeneratorFunction (constant, wrapperInfo.getInitFromWrappedValue (),
998
- /* EmitProfilerIncrement*/ true );
987
+ SGF.emitGeneratorFunction (constant, init, /* EmitProfilerIncrement*/ true );
999
988
postEmitFunction (constant, f);
1000
989
break ;
1001
990
}
@@ -1007,12 +996,14 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
1007
996
preEmitFunction (constant, f, loc);
1008
997
PrettyStackTraceSILFunction X (
1009
998
" silgen emitPropertyWrapperInitFromProjectedValue" , f);
1010
- auto initInfo = var->getPropertyWrapperInitializerInfo ();
1011
- assert (initInfo.hasInitFromProjectedValue ());
1012
- f->createProfiler (initInfo.getInitFromProjectedValue (), constant);
999
+
1000
+ auto *init = constant.getInitializationExpr ();
1001
+ assert (init);
1002
+
1003
+ f->createProfiler (init, constant);
1013
1004
auto varDC = var->getInnermostDeclContext ();
1014
1005
SILGenFunction SGF (*this , *f, varDC);
1015
- SGF.emitGeneratorFunction (constant, initInfo. getInitFromProjectedValue () );
1006
+ SGF.emitGeneratorFunction (constant, init );
1016
1007
postEmitFunction (constant, f);
1017
1008
break ;
1018
1009
}
0 commit comments