File tree Expand file tree Collapse file tree 4 files changed +11
-21
lines changed Expand file tree Collapse file tree 4 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -2852,8 +2852,7 @@ void SourceFile::lookupImportedSPIGroups(
2852
2852
for (auto &import : *Imports) {
2853
2853
if (import .options .contains (ImportFlags::SPIAccessControl) &&
2854
2854
importedModule == import .module .importedModule ) {
2855
- auto importedSpis = import .spiGroups ;
2856
- spiGroups.insert (importedSpis.begin (), importedSpis.end ());
2855
+ spiGroups.insert (import .spiGroups .begin (), import .spiGroups .end ());
2857
2856
}
2858
2857
}
2859
2858
}
Original file line number Diff line number Diff line change @@ -889,18 +889,6 @@ void ModuleFile::lookupObjCMethods(
889
889
}
890
890
}
891
891
892
- void ModuleFile::lookupImportedSPIGroups (
893
- const ModuleDecl *importedModule,
894
- llvm::SmallSetVector<Identifier, 4 > &spiGroups) const {
895
- for (auto &dep : Dependencies) {
896
- auto depSpis = dep.spiGroups ;
897
- if (dep.Import .hasValue () && dep.Import ->importedModule == importedModule &&
898
- !depSpis.empty ()) {
899
- spiGroups.insert (depSpis.begin (), depSpis.end ());
900
- }
901
- }
902
- }
903
-
904
892
void
905
893
ModuleFile::collectLinkLibraries (ModuleDecl::LinkLibraryCallback callback) const {
906
894
for (const auto &lib : Core->LinkLibraries )
Original file line number Diff line number Diff line change @@ -670,12 +670,6 @@ class ModuleFile
670
670
ObjCSelector selector,
671
671
SmallVectorImpl<AbstractFunctionDecl *> &results);
672
672
673
- // / Find all SPI names imported from \p importedModule by this module,
674
- // / collecting the identifiers in \p spiGroups.
675
- void lookupImportedSPIGroups (
676
- const ModuleDecl *importedModule,
677
- llvm::SmallSetVector<Identifier, 4 > &spiGroups) const ;
678
-
679
673
// / Reports all link-time dependencies.
680
674
void collectLinkLibraries (ModuleDecl::LinkLibraryCallback callback) const ;
681
675
Original file line number Diff line number Diff line change 15
15
#include " ModuleFileSharedCore.h"
16
16
#include " swift/AST/ASTContext.h"
17
17
#include " swift/AST/DiagnosticsSema.h"
18
+ #include " swift/AST/ImportCache.h"
18
19
#include " swift/AST/ModuleDependencies.h"
19
20
#include " swift/Basic/Defer.h"
20
21
#include " swift/Basic/FileTypes.h"
@@ -1486,7 +1487,15 @@ SerializedASTFile::loadFingerprint(const IterableDeclContext *IDC) const {
1486
1487
void SerializedASTFile::lookupImportedSPIGroups (
1487
1488
const ModuleDecl *importedModule,
1488
1489
llvm::SmallSetVector<Identifier, 4 > &spiGroups) const {
1489
- File.lookupImportedSPIGroups (importedModule, spiGroups);
1490
+ auto M = getParentModule ();
1491
+ for (auto &dep : File.Dependencies ) {
1492
+ if (!dep.Import .hasValue ())
1493
+ continue ;
1494
+
1495
+ if (dep.Import ->importedModule == importedModule) {
1496
+ spiGroups.insert (dep.spiGroups .begin (), dep.spiGroups .end ());
1497
+ }
1498
+ }
1490
1499
}
1491
1500
1492
1501
Optional<CommentInfo>
You can’t perform that action at this time.
0 commit comments