mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add an interface mode getter/setter in PrintOptions and ModuleInterfaceOptions
Update args parsing
This commit is contained in:
@@ -55,9 +55,6 @@ struct ModuleInterfaceOptions {
|
||||
/// e.g. -package-name PACKAGE_ID
|
||||
std::string IgnorablePrivateFlags;
|
||||
|
||||
/// Prints package, SPIs, or public/inlinable decls depending on the mode.
|
||||
InterfaceMode InterfaceContentMode = InterfaceMode::Public;
|
||||
|
||||
/// Print imports with both @_implementationOnly and @_spi, only applies
|
||||
/// when PrintSPIs is true.
|
||||
bool ExperimentalSPIImports = false;
|
||||
@@ -70,6 +67,18 @@ struct ModuleInterfaceOptions {
|
||||
|
||||
/// A list of modules we shouldn't import in the public interfaces.
|
||||
std::vector<std::string> ModulesToSkipInPublicInterface;
|
||||
|
||||
/// A mode which decides whether the printed interface contains package, SPIs, or public/inlinable declarations.
|
||||
PrintOptions::InterfaceMode InterfaceContentMode = PrintOptions::InterfaceMode::Public;
|
||||
bool printPublicInterface() const {
|
||||
return InterfaceContentMode == PrintOptions::InterfaceMode::Public;
|
||||
}
|
||||
bool printPackageInterface() const {
|
||||
return InterfaceContentMode == PrintOptions::InterfaceMode::Package;
|
||||
}
|
||||
void setInterfaceMode(PrintOptions::InterfaceMode mode) {
|
||||
InterfaceContentMode = mode;
|
||||
}
|
||||
};
|
||||
|
||||
extern version::Version InterfaceFormatVersion;
|
||||
|
||||
Reference in New Issue
Block a user