Add an interface mode getter/setter in PrintOptions and ModuleInterfaceOptions

Update args parsing
This commit is contained in:
Ellie Shin
2023-11-13 13:47:30 -08:00
parent e5ca8e5c0b
commit 9d716394b1
7 changed files with 62 additions and 43 deletions

View File

@@ -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;