mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: Add OFast flag
The optimization level -OFast disables runtime checks (overflow, type checks) and assertions. rdar://16458612 Swift SVN r16474
This commit is contained in:
@@ -684,6 +684,13 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
|
||||
if (A->getOption().matches(OPT_O0)) {
|
||||
IRGenOpts.OptLevel = 0;
|
||||
} else if (A->getOption().matches(OPT_OFast)) {
|
||||
// Set the maximum optimization level and remove all runtime checks.
|
||||
IRGenOpts.OptLevel = MaxLevel;
|
||||
// Unchecked casts.
|
||||
IRGenOpts.DisableAllRuntimeChecks = true;
|
||||
// Removal of cond_fail (overflow on binary operations).
|
||||
Opts.RemoveRuntimeAsserts = true;
|
||||
} else {
|
||||
unsigned OptLevel;
|
||||
if (StringRef(A->getValue()).getAsInteger(10, OptLevel) ||
|
||||
|
||||
Reference in New Issue
Block a user