Skip to content

Commit a4bcbfa

Browse files
committed
[NFC] Remove a Dead Parameter From Clang Module Loading
The only caller consuming the data that resulted from this bit has it set to false. Additionally, the side effect of force-loading the overlays is already handled unconditionally by the call to namelookup::getAllImports.
1 parent e7f38db commit a4bcbfa

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,8 +1779,7 @@ ModuleDecl *ClangImporter::Implementation::loadModuleClang(
17791779
if (!clangModule)
17801780
return nullptr;
17811781

1782-
return finishLoadingClangModule(importLoc, clangModule,
1783-
/*preferOverlay=*/false);
1782+
return finishLoadingClangModule(importLoc, clangModule);
17841783
}
17851784

17861785
ModuleDecl *
@@ -1800,7 +1799,7 @@ ModuleDecl *ClangImporter::Implementation::loadModule(
18001799
}
18011800

18021801
ModuleDecl *ClangImporter::Implementation::finishLoadingClangModule(
1803-
SourceLoc importLoc, const clang::Module *clangModule, bool findOverlay) {
1802+
SourceLoc importLoc, const clang::Module *clangModule) {
18041803
assert(clangModule);
18051804

18061805
// Bump the generation count.
@@ -1842,17 +1841,13 @@ ModuleDecl *ClangImporter::Implementation::finishLoadingClangModule(
18421841
}
18431842

18441843
if (clangModule->isSubModule()) {
1845-
finishLoadingClangModule(importLoc, clangModule->getTopLevelModule(), true);
1844+
finishLoadingClangModule(importLoc, clangModule->getTopLevelModule());
18461845
} else {
18471846
ModuleDecl *&loaded = SwiftContext.LoadedModules[result->getName()];
18481847
if (!loaded)
18491848
loaded = result;
18501849
}
18511850

1852-
if (findOverlay)
1853-
if (ModuleDecl *overlay = wrapperUnit->getOverlayModule())
1854-
result = overlay;
1855-
18561851
return result;
18571852
}
18581853

@@ -1876,8 +1871,7 @@ void ClangImporter::Implementation::handleDeferredImports(SourceLoc diagLoc) {
18761871
// officially supported with bridging headers: app targets and unit tests
18771872
// only. Unfortunately that's not enforced.
18781873
for (size_t i = 0; i < ImportedHeaderExports.size(); ++i) {
1879-
(void)finishLoadingClangModule(diagLoc, ImportedHeaderExports[i],
1880-
/*preferOverlay=*/true);
1874+
(void)finishLoadingClangModule(diagLoc, ImportedHeaderExports[i]);
18811875
}
18821876
}
18831877

lib/ClangImporter/ImporterImpl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
926926

927927
/// Constructs a Swift module for the given Clang module.
928928
ModuleDecl *finishLoadingClangModule(SourceLoc importLoc,
929-
const clang::Module *clangModule,
930-
bool preferOverlay);
929+
const clang::Module *clangModule);
931930

932931
/// Call finishLoadingClangModule on each deferred import collected
933932
/// while scanning a bridging header or PCH.

0 commit comments

Comments
 (0)