mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #76269 from xymus/public-module-name
Diagnostics: Intro the public module name concept to hide support modules from clients
This commit is contained in:
@@ -243,6 +243,8 @@ class ModuleDecl
|
||||
/// Module name to use when referenced in clients module interfaces.
|
||||
mutable Identifier ExportAsName;
|
||||
|
||||
mutable Identifier PublicModuleName;
|
||||
|
||||
public:
|
||||
/// Produces the components of a given module's full name in reverse order.
|
||||
///
|
||||
@@ -502,6 +504,21 @@ public:
|
||||
ExportAsName = name;
|
||||
}
|
||||
|
||||
/// Public facing name for this module in diagnostics and documentation.
|
||||
///
|
||||
/// This always returns a valid name as it defaults to the module name if
|
||||
/// no public module name is set.
|
||||
///
|
||||
/// If `onlyIfImported`, return the normal module name when the module
|
||||
/// corresponding to the public module name isn't imported. Users working
|
||||
/// in between both modules will then see the normal module name,
|
||||
/// this may be more useful for diagnostics at that level.
|
||||
Identifier getPublicModuleName(bool onlyIfImported) const;
|
||||
|
||||
void setPublicModuleName(Identifier name) {
|
||||
PublicModuleName = name;
|
||||
}
|
||||
|
||||
/// Retrieve the actual module name of an alias used for this module (if any).
|
||||
///
|
||||
/// For example, if '-module-alias Foo=Bar' is passed in when building the main module,
|
||||
|
||||
Reference in New Issue
Block a user