File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,20 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
573573 visitAbstractStorageDecl (SD);
574574 }
575575
576+ template <typename NominalOrExtension>
577+ void visitMembers (NominalOrExtension *D) {
578+ if (!Ctx.getOpts ().VisitMembers )
579+ return ;
580+
581+ for (auto member : D->getMembers ()) {
582+ member->visitAuxiliaryDecls ([&](Decl *decl) {
583+ visit (decl);
584+ });
585+
586+ visit (member);
587+ }
588+ }
589+
576590 void visitNominalTypeDecl (NominalTypeDecl *NTD) {
577591 auto declaredType = NTD->getDeclaredType ()->getCanonicalType ();
578592
@@ -591,9 +605,7 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
591605
592606 addRuntimeDiscoverableAttrGenerators (NTD);
593607
594- if (Ctx.getOpts ().VisitMembers )
595- for (auto member : NTD->getMembers ())
596- visit (member);
608+ visitMembers (NTD);
597609 }
598610
599611 void visitClassDecl (ClassDecl *CD) {
@@ -682,9 +694,7 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
682694 addConformances (ED);
683695 }
684696
685- if (Ctx.getOpts ().VisitMembers )
686- for (auto member : ED->getMembers ())
687- visit (member);
697+ visitMembers (ED);
688698 }
689699
690700#ifndef NDEBUG
Original file line number Diff line number Diff line change 77// RUN: %target-build-swift -swift-version 5 -Xfrontend -disable-availability-checking -load-plugin-library %t/%target-library-name(MacroDefinition) -parse-as-library -I %swift-host-lib-dir -L %swift-host-lib-dir %s -o %t/main -module-name MacroUser
88// RUN: %target-run %t/main | %FileCheck %s -check-prefix=CHECK-EXEC
99
10+ // Emit module while skipping function bodies
11+ // RUN: %target-swift-frontend -swift-version 5 -emit-module -load-plugin-library %t/%target-library-name(MacroDefinition) -parse-as-library -I %swift-host-lib-dir %s -disable-availability-checking -o %t/macro_expand_peers.swiftmodule -experimental-skip-non-inlinable-function-bodies-without-types
12+
1013// FIXME: Swift parser is not enabled on Linux CI yet.
1114// REQUIRES: OS=macosx
1215
You can’t perform that action at this time.
0 commit comments