mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Error on xref to implementation-only dependencies
Introduce a last resort check reporting references to implementation-only dependencies that would appear in the generated swiftmodule. This check is applied at serialization, long after exportability checking applied at typechecking. It should act as a back stop to references missed by typechecking or @_implementationOnly decls that should have been skipped. This check is gated behind CheckImplementationOnlyStrict and should be used with embedded only. rdar://160697599
This commit is contained in:
@@ -1064,11 +1064,15 @@ public:
|
||||
void
|
||||
getImportedModulesForLookup(SmallVectorImpl<ImportedModule> &imports) const;
|
||||
|
||||
/// Has \p module been imported via an '@_implementationOnly' import
|
||||
/// instead of another kind of import?
|
||||
/// Has \p module been imported via an '@_implementationOnly' import and
|
||||
/// not by anything more visible?
|
||||
///
|
||||
/// This assumes that \p module was imported.
|
||||
bool isImportedImplementationOnly(const ModuleDecl *module) const;
|
||||
/// If \p assumeImported, assume that \p module was imported and avoid the
|
||||
/// work to confirm it is imported at all. Transitive modules not reexported
|
||||
/// are not considered imported here and may lead to false positive without
|
||||
/// this setting.
|
||||
bool isImportedImplementationOnly(const ModuleDecl *module,
|
||||
bool assumeImported = true) const;
|
||||
|
||||
/// Finds all top-level decls of this module.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user