mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Disable runtime exclusivity checks with -Ounchecked.
If runtime asserts are disabled in general, also disable runtime exclusivity checks unless explicitly requested. -Ounchecked is an unsupported benchmarking mode, but, if used, it should disable all runtime assertions. Exclusivity checks are no more essential than integer overflow or bounds checks.
This commit is contained in:
@@ -771,6 +771,11 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
Opts.VerifyExclusivity
|
||||
= A->getOption().matches(OPT_enable_verify_exclusivity);
|
||||
}
|
||||
// If runtime asserts are disabled in general, also disable runtime
|
||||
// exclusivity checks unless explicitly requested.
|
||||
if (Opts.RemoveRuntimeAsserts)
|
||||
Opts.EnforceExclusivityDynamic = false;
|
||||
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_enforce_exclusivity_EQ)) {
|
||||
parseExclusivityEnforcementOptions(A, Opts, Diags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user