File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,13 @@ gatherConstValuesForModule(const std::unordered_set<std::string> &Protocols,
572572 NominalTypeConformanceCollector ConformanceCollector (Protocols,
573573 ConformanceDecls);
574574 Module->walk (ConformanceCollector);
575+ // Visit macro expanded extensions
576+ for (auto *FU : Module->getFiles ())
577+ if (auto *synthesizedSF = FU->getSynthesizedFile ())
578+ for (auto D : synthesizedSF->getTopLevelDecls ())
579+ if (isa<ExtensionDecl>(D))
580+ D->walk (ConformanceCollector);
581+
575582 for (auto *CD : ConformanceDecls)
576583 Result.emplace_back (evaluateOrDefault (CD->getASTContext ().evaluator ,
577584 ConstantValueInfoRequest{CD, Module},
Original file line number Diff line number Diff line change 77// RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractFromMacroExpansion.swiftconstvalues -const-gather-protocols-file %t/protocols.json -primary-file %s -load-plugin-library %t/%target-library-name(MacroDefinition)
88// RUN: cat %t/ExtractFromMacroExpansion.swiftconstvalues 2>&1 | %FileCheck %s
99
10+ // Do the same, but ensure the WMO compilation flow produces the same result
11+ // RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractFromMacroExpansionWMO.swiftconstvalues -const-gather-protocols-file %t/protocols.json -O %s -load-plugin-library %t/%target-library-name(MacroDefinition)
12+ // RUN: cat %t/ExtractFromMacroExpansionWMO.swiftconstvalues 2>&1 | %FileCheck %s
13+
1014protocol MyProto { }
1115
1216@freestanding ( declaration, names: named ( MacroAddedStruct) )
You can’t perform that action at this time.
0 commit comments