[Sema] Report public imports of private modules

Intro the concept of library access or distribution level to identify
layers of libraries and report public imports of private libraries from
public ones.

rdar://62934005
This commit is contained in:
Alexis Laferrière
2021-03-12 09:32:03 -08:00
parent 58f03e8490
commit cf58bb7eb4
19 changed files with 207 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ namespace swift {
class FileUnit;
class FuncDecl;
class InfixOperatorDecl;
enum class LibraryLevel : uint8_t;
class LinkLibrary;
class ModuleLoader;
class NominalTypeDecl;
@@ -462,6 +463,9 @@ public:
Bits.ModuleDecl.RawResilienceStrategy = unsigned(strategy);
}
/// Distribution level of the module.
LibraryLevel getLibraryLevel() const;
/// Returns true if this module was or is being compiled for testing.
bool hasIncrementalInfo() const { return Bits.ModuleDecl.HasIncrementalInfo; }
void setHasIncrementalInfo(bool enabled = true) {