File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -5910,6 +5910,11 @@ void VarDecl::visitAuxiliaryDecls(llvm::function_ref<void(VarDecl *)> visit) con
5910
5910
if (getDeclContext ()->isTypeContext ())
5911
5911
return ;
5912
5912
5913
+ // Avoid request evaluator overhead in the common case where there's
5914
+ // no wrapper.
5915
+ if (!getAttrs ().hasAttribute <CustomAttr>())
5916
+ return ;
5917
+
5913
5918
if (auto *backingVar = getPropertyWrapperBackingProperty ())
5914
5919
visit (backingVar);
5915
5920
Original file line number Diff line number Diff line change @@ -1220,17 +1220,21 @@ void SILGenFunction::visitPatternBindingDecl(PatternBindingDecl *PBD) {
1220
1220
void SILGenFunction::visitVarDecl (VarDecl *D) {
1221
1221
// We handle emitting the variable storage when we see the pattern binding.
1222
1222
1223
- // Emit the property wrapper backing initializer if necessary.
1224
- auto wrapperInfo = D->getPropertyWrapperBackingPropertyInfo ();
1225
- if (wrapperInfo && wrapperInfo.initializeFromOriginal )
1226
- SGM.emitPropertyWrapperBackingInitializer (D);
1223
+ // Avoid request evaluator overhead in the common case where there's
1224
+ // no wrapper.
1225
+ if (D->getAttrs ().hasAttribute <CustomAttr>()) {
1226
+ // Emit the property wrapper backing initializer if necessary.
1227
+ auto wrapperInfo = D->getPropertyWrapperBackingPropertyInfo ();
1228
+ if (wrapperInfo && wrapperInfo.initializeFromOriginal )
1229
+ SGM.emitPropertyWrapperBackingInitializer (D);
1227
1230
1228
- D->visitAuxiliaryDecls ([&](VarDecl *var) {
1229
- if (auto *patternBinding = var->getParentPatternBinding ())
1230
- visitPatternBindingDecl (patternBinding);
1231
+ D->visitAuxiliaryDecls ([&](VarDecl *var) {
1232
+ if (auto *patternBinding = var->getParentPatternBinding ())
1233
+ visitPatternBindingDecl (patternBinding);
1231
1234
1232
- visit (var);
1233
- });
1235
+ visit (var);
1236
+ });
1237
+ }
1234
1238
1235
1239
// Emit the variable's accessors.
1236
1240
D->visitEmittedAccessors ([&](AccessorDecl *accessor) {
You can’t perform that action at this time.
0 commit comments