mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Accept and store the IPI library-level
Prepare to accept the `ipi` argument to the `-library-level` flag. IPI stands for Internal Programming Interface and would describe a module that's not to be distributed outside of its project. In the future, the compiler could use that information to report when a distributed module (api or spi) imports publicly a module that's not distributed. rdar://102435183
This commit is contained in:
@@ -704,17 +704,15 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.LibraryLevel = LibraryLevel::API;
|
||||
} else if (contents == "spi") {
|
||||
Opts.LibraryLevel = LibraryLevel::SPI;
|
||||
} else if (contents == "ipi") {
|
||||
Opts.LibraryLevel = LibraryLevel::IPI;
|
||||
} else {
|
||||
Opts.LibraryLevel = LibraryLevel::Other;
|
||||
if (contents != "other") {
|
||||
// Error on unknown library levels.
|
||||
auto inFlight = Diags.diagnose(SourceLoc(),
|
||||
diag::error_unknown_library_level,
|
||||
contents);
|
||||
|
||||
// Only warn for "ipi" as we may use it in the future.
|
||||
if (contents == "ipi")
|
||||
inFlight.limitBehavior(DiagnosticBehavior::Warning);
|
||||
Diags.diagnose(SourceLoc(),
|
||||
diag::error_unknown_library_level,
|
||||
contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user