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> {
573
573
visitAbstractStorageDecl (SD);
574
574
}
575
575
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
+
576
590
void visitNominalTypeDecl (NominalTypeDecl *NTD) {
577
591
auto declaredType = NTD->getDeclaredType ()->getCanonicalType ();
578
592
@@ -591,9 +605,7 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
591
605
592
606
addRuntimeDiscoverableAttrGenerators (NTD);
593
607
594
- if (Ctx.getOpts ().VisitMembers )
595
- for (auto member : NTD->getMembers ())
596
- visit (member);
608
+ visitMembers (NTD);
597
609
}
598
610
599
611
void visitClassDecl (ClassDecl *CD) {
@@ -682,9 +694,7 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
682
694
addConformances (ED);
683
695
}
684
696
685
- if (Ctx.getOpts ().VisitMembers )
686
- for (auto member : ED->getMembers ())
687
- visit (member);
697
+ visitMembers (ED);
688
698
}
689
699
690
700
#ifndef NDEBUG
Original file line number Diff line number Diff line change 7
7
// 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
8
8
// RUN: %target-run %t/main | %FileCheck %s -check-prefix=CHECK-EXEC
9
9
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
+
10
13
// FIXME: Swift parser is not enabled on Linux CI yet.
11
14
// REQUIRES: OS=macosx
12
15
You can’t perform that action at this time.
0 commit comments