[region-isolation] Enable region isolation by default with strict-concurrency.

I added a disable flag -disable-region-based-isolation-with-strict-concurrency
so that we do not need to update the current tests. It is only available when
asserts are enabled to ensure users cannot use it.

rdar://125918028
This commit is contained in:
Michael Gottesman
2024-03-12 15:00:34 -07:00
parent c2350dfe7e
commit b3e837c16c
32 changed files with 84 additions and 55 deletions

View File

@@ -1060,6 +1060,16 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (Opts.StrictConcurrencyLevel == StrictConcurrency::Complete) {
Opts.enableFeature(Feature::IsolatedDefaultValues);
Opts.enableFeature(Feature::GlobalConcurrency);
// If asserts are enabled, allow for region based isolation to be disabled
// with a flag. This is intended only to be used with tests.
bool enableRegionIsolation = true;
#ifndef NDEBUG
enableRegionIsolation =
!Args.hasArg(OPT_disable_strict_concurrency_region_based_isolation);
#endif
if (enableRegionIsolation)
Opts.enableFeature(Feature::RegionBasedIsolation);
}
Opts.WarnImplicitOverrides =