Sema: Downgrade potentially unavailable enum cases to a warning in module interfaces

There are two pieces here:

- A -warn-on-potentially-unavailable-enum-case flag is passed down by
  the driver when *producing* a swiftinterface

- When *consuming* a swiftinterface, also enable this behavior

Part of rdar://problem/78306593.
This commit is contained in:
Slava Pestov
2021-06-08 15:44:15 -04:00
parent 85891fdc82
commit 765ce78992
8 changed files with 54 additions and 3 deletions

View File

@@ -457,6 +457,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
= A->getOption().matches(OPT_enable_conformance_availability_errors);
}
Opts.WarnOnPotentiallyUnavailableEnumCase |=
Args.hasArg(OPT_warn_on_potentially_unavailable_enum_case);
if (auto A = Args.getLastArg(OPT_enable_access_control,
OPT_disable_access_control)) {
Opts.EnableAccessControl