Enable enforce-exclusivity=checked at -Onone.

This enables dynamic checking at -Onone.

Static checking is enabled by default regardless of optimizations.

SILGen only emits dynamic markers at -Onone, or when explicitly requested with
-enforce-exclusivity=checked|dynamic.

All access markers are stripped at the start of the optimization pipeline
regardless of optimization level or command line flags.
This commit is contained in:
Andrew Trick
2017-05-30 09:35:54 -07:00
parent 5c759ad9b6
commit 25d17e9933
3 changed files with 32 additions and 23 deletions

View File

@@ -1414,6 +1414,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
IRGenOpts.Sanitize = Opts.Sanitize;
}
if (Opts.Optimization > SILOptions::SILOptMode::None)
Opts.EnforceExclusivityDynamic = false;
if (const Arg *A = Args.getLastArg(options::OPT_enforce_exclusivity_EQ)) {
parseExclusivityEnforcementOptions(A, Opts, Diags);
}