mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] Intro flag to limit availability checks to the API
Intro the frontend flag `-check-api-availability-only` that limits availability checking to the API and SPI. This mode doesn't check the availability of non-inlinable function bodies and of non-ABI-public decl signatures. This mode goal is to check all that is printed in the swiftinterface file. It should be used in place of the wider `-disable-availability-checking` when generating an interface for platforms with no binaries. rdar://81679692
This commit is contained in:
@@ -473,6 +473,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.DisableAvailabilityChecking |=
|
||||
Args.hasArg(OPT_disable_availability_checking);
|
||||
Opts.CheckAPIAvailabilityOnly |=
|
||||
Args.hasArg(OPT_check_api_availability_only);
|
||||
|
||||
if (auto A = Args.getLastArg(OPT_enable_conformance_availability_errors,
|
||||
OPT_disable_conformance_availability_errors)) {
|
||||
@@ -915,6 +917,12 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
|
||||
Opts.DebugTimeExpressions |=
|
||||
Args.hasArg(OPT_debug_time_expression_type_checking);
|
||||
|
||||
// Checking availability of the API only relies on skipping non-inlinable
|
||||
// function bodies. Define it first so it can be overridden by the other
|
||||
// flags.
|
||||
if (Args.hasArg(OPT_check_api_availability_only))
|
||||
Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinable;
|
||||
|
||||
// Check for SkipFunctionBodies arguments in order from skipping less to
|
||||
// skipping more.
|
||||
if (Args.hasArg(
|
||||
|
||||
Reference in New Issue
Block a user