mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Ignore transitive ObjC imports when cross-importing
This behavior change reduces the chance of unexpected and unwanted cross-imports being performed. Fixes rdar://problem/60554019.
This commit is contained in:
@@ -508,7 +508,7 @@ SourceLookupCache &ModuleDecl::getSourceLookupCache() const {
|
||||
return *Cache;
|
||||
}
|
||||
|
||||
ModuleDecl *ModuleDecl::getTopLevelModule() {
|
||||
ModuleDecl *ModuleDecl::getTopLevelModule(bool overlay) {
|
||||
// If this is a Clang module, ask the Clang importer for the top-level module.
|
||||
// We need to check isNonSwiftModule() to ensure we don't look through
|
||||
// overlays.
|
||||
@@ -516,7 +516,8 @@ ModuleDecl *ModuleDecl::getTopLevelModule() {
|
||||
if (auto *underlying = findUnderlyingClangModule()) {
|
||||
auto &ctx = getASTContext();
|
||||
auto *clangLoader = ctx.getClangModuleLoader();
|
||||
return clangLoader->getWrapperForModule(underlying->getTopLevelModule());
|
||||
return clangLoader->getWrapperForModule(underlying->getTopLevelModule(),
|
||||
overlay);
|
||||
}
|
||||
}
|
||||
// Swift modules don't currently support submodules.
|
||||
|
||||
Reference in New Issue
Block a user