Skip to content

Commit

Permalink
Merge pull request swiftlang#12995 from eeckstein/driver-options
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci authored Nov 17, 2017
2 parents c9e9c90 + 89ffd4c commit 26fee83
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 0 additions & 3 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ def enable_guaranteed_closure_contexts : Flag<["-"], "enable-guaranteed-closure-
def disable_sil_partial_apply : Flag<["-"], "disable-sil-partial-apply">,
HelpText<"Disable use of partial_apply in SIL generation">;

def remove_runtime_asserts : Flag<["-"], "remove-runtime-asserts">,
HelpText<"Remove runtime asserts.">;

def disable_access_control : Flag<["-"], "disable-access-control">,
HelpText<"Don't respect access control restrictions">;
def enable_access_control : Flag<["-"], "enable-access-control">,
Expand Down
3 changes: 3 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ def Oplayground : Flag<["-"], "Oplayground">, Group<O_Group>,
Flags<[HelpHidden, FrontendOption]>,
HelpText<"Compile with optimizations appropriate for a playground">;

def RemoveRuntimeAsserts : Flag<["-"], "remove-runtime-asserts">,
Flags<[FrontendOption]>,
HelpText<"Remove runtime safety checks.">;
def AssumeSingleThreaded : Flag<["-"], "assume-single-threaded">,
Flags<[FrontendOption, HelpHidden]>,
HelpText<"Assume that code will be executed in a single-threaded "
Expand Down
2 changes: 2 additions & 0 deletions lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ static void addCommonFrontendArgs(const ToolChain &TC,
inputArgs.AddLastArg(arguments,
options::OPT_solver_shrink_unsolved_threshold);
inputArgs.AddLastArg(arguments, options::OPT_O_Group);
inputArgs.AddLastArg(arguments, options::OPT_RemoveRuntimeAsserts);
inputArgs.AddLastArg(arguments, options::OPT_AssumeSingleThreaded);

// Pass on any build config options
inputArgs.AddAllArgs(arguments, options::OPT_D);
Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
}

// -Ounchecked might also set removal of runtime asserts (cond_fail).
Opts.RemoveRuntimeAsserts |= Args.hasArg(OPT_remove_runtime_asserts);
Opts.RemoveRuntimeAsserts |= Args.hasArg(OPT_RemoveRuntimeAsserts);

Opts.EnableARCOptimizations |= !Args.hasArg(OPT_disable_arc_opts);
Opts.DisableSILPerfOptimizations |= Args.hasArg(OPT_disable_sil_perf_optzns);
Expand Down
8 changes: 8 additions & 0 deletions test/Driver/options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@
// RUN: %swiftc_driver -driver-print-jobs -enforce-exclusivity=checked %s | %FileCheck -check-prefix=EXCLUSIVITY_CHECKED %s
// EXCLUSIVITY_CHECKED: swift
// EXCLUSIVITY_CHECKED: -enforce-exclusivity=checked

// RUN: %swiftc_driver -driver-print-jobs -remove-runtime-asserts %s | %FileCheck -check-prefix=REMOVE_RUNTIME_ASSERTS %s
// REMOVE_RUNTIME_ASSERTS: swift
// REMOVE_RUNTIME_ASSERTS: -frontend {{.*}} -remove-runtime-asserts

// RUN: %swiftc_driver -driver-print-jobs -assume-single-threaded %s | %FileCheck -check-prefix=ASSUME_SINGLE_THREADED %s
// ASSUME_SINGLE_THREADED: swift
// ASSUME_SINGLE_THREADED: -frontend {{.*}} -assume-single-threaded

0 comments on commit 26fee83

Please sign in to comment.