mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sending] Make {Transferring,Sending}ArgsAndResults a LANGUAGE_FEATURE instead of an UPCOMING_FEATURE.
TLDR: This makes it so that we always can parse sending/transferring but changes the semantic language effects to be keyed on RegionBasedIsolation instead. ---- The key thing that makes this all work is that I changed all of the "special" semantic changes originally triggered on *ArgsAndResults to now be triggered based on RegionBasedIsolation being enabled. This makes a lot of sense since we want these semantic changes specifically to be combined with the checkers that RegionBasedIsolation turns on. As a result, even though this causes these two features to always be enabled, we just parse it but we do not use it for anything semantically. rdar://128961672
This commit is contained in:
@@ -1112,34 +1112,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.enableFeature(Feature::RegionBasedIsolation);
|
||||
}
|
||||
|
||||
// Enable TransferringArgsAndResults/SendingArgsAndResults whenever
|
||||
// RegionIsolation is enabled.
|
||||
if (Opts.hasFeature(Feature::RegionBasedIsolation)) {
|
||||
bool enableTransferringArgsAndResults = true;
|
||||
bool enableSendingArgsAndResults = true;
|
||||
#ifndef NDEBUG
|
||||
enableTransferringArgsAndResults = !Args.hasArg(
|
||||
OPT_disable_transferring_args_and_results_with_region_isolation);
|
||||
enableSendingArgsAndResults = !Args.hasArg(
|
||||
OPT_disable_sending_args_and_results_with_region_isolation);
|
||||
#endif
|
||||
if (enableTransferringArgsAndResults)
|
||||
Opts.enableFeature(Feature::TransferringArgsAndResults);
|
||||
if (enableSendingArgsAndResults)
|
||||
Opts.enableFeature(Feature::SendingArgsAndResults);
|
||||
}
|
||||
|
||||
// Enable SendingArgsAndResults whenever TransferringArgsAndResults is
|
||||
// enabled.
|
||||
//
|
||||
// The reason that we are doing this is we want to phase out transferring in
|
||||
// favor of sending and this ensures that if we output 'sending' instead of
|
||||
// 'transferring' (for instance when emitting suppressed APIs), we know that
|
||||
// the compiler will be able to handle sending as well.
|
||||
if (Opts.hasFeature(Feature::TransferringArgsAndResults)) {
|
||||
Opts.enableFeature(Feature::SendingArgsAndResults);
|
||||
}
|
||||
|
||||
Opts.WarnImplicitOverrides =
|
||||
Args.hasArg(OPT_warn_implicit_overrides);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user