mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SourceKit: avoid self-imports in generated Swift interfaces
Generated Swift interfaces for modules with overlays, like Foundation or Dispatch, currently contain `import Foundation`/`import Dispatch` statements. These imports are redundant, and this change removes them.
This commit is contained in:
@@ -609,6 +609,9 @@ void swift::ide::printModuleInterface(
|
||||
auto ShouldPrintImport = [&](ImportDecl *ImportD) -> bool {
|
||||
if (!TargetClangMod)
|
||||
return true;
|
||||
if (ImportD->getModule() == TargetMod)
|
||||
return false;
|
||||
|
||||
auto ImportedMod = ImportD->getClangModule();
|
||||
if (!ImportedMod)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user