Merge pull request #62148 from xymus/library-level-ipi-intro

[Sema] Accept and store the IPI library-level
This commit is contained in:
Alexis Laferrière
2022-11-17 13:34:27 -08:00
committed by GitHub
4 changed files with 14 additions and 9 deletions

View File

@@ -720,17 +720,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);
}
}
}