SourceKit: do not print implementation-only imports

Implementation-only imports are unnecessary in generated module interfaces, since they aren't exported to the module's dependencies, and the module's public API cannot refer to symbols imported as implementation-only.
This commit is contained in:
Egor Zhdan
2021-01-21 21:15:28 +03:00
parent f7f658cce7
commit cb5936688c
3 changed files with 8 additions and 1 deletions

View File

@@ -499,6 +499,10 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
if (Dep.isExported())
ID->getAttrs().add(
new (Ctx) ExportedAttr(/*IsImplicit=*/false));
if (Dep.isImplementationOnly())
ID->getAttrs().add(
new (Ctx) ImplementationOnlyAttr(/*IsImplicit=*/false));
ImportDecls.push_back(ID);
}
Bits.ComputedImportDecls = true;