mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Move the package name option from frontend to LangOptions
This commit is contained in:
@@ -739,6 +739,16 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
}
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_package_name)) {
|
||||
auto pkgName = A->getValue();
|
||||
if (!Lexer::isIdentifier(pkgName))
|
||||
Diags.diagnose(SourceLoc(), diag::error_bad_package_name, pkgName);
|
||||
else if (pkgName == STDLIB_NAME)
|
||||
Diags.diagnose(SourceLoc(), diag::error_stdlib_package_name, pkgName);
|
||||
else
|
||||
Opts.PackageName = pkgName;
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_require_explicit_availability_EQ)) {
|
||||
StringRef diagLevel = A->getValue();
|
||||
if (diagLevel == "warn") {
|
||||
|
||||
Reference in New Issue
Block a user