Skip to content

Commit 6a2ca37

Browse files
committed
add -Z always-build-mir option
1 parent 9bd35c0 commit 6a2ca37

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc/session/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub struct Options {
104104
pub parse_only: bool,
105105
pub no_trans: bool,
106106
pub treat_err_as_bug: bool,
107+
pub always_build_mir: bool,
107108
pub no_analysis: bool,
108109
pub debugging_opts: DebuggingOptions,
109110
/// Whether to write dependency files. It's (enabled, optional filename).
@@ -216,6 +217,7 @@ pub fn basic_options() -> Options {
216217
parse_only: false,
217218
no_trans: false,
218219
treat_err_as_bug: false,
220+
always_build_mir: false,
219221
no_analysis: false,
220222
debugging_opts: basic_debugging_options(),
221223
write_dependency_info: (false, None),
@@ -583,6 +585,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
583585
"Run all passes except translation; no output"),
584586
treat_err_as_bug: bool = (false, parse_bool,
585587
"Treat all errors that occur as bugs"),
588+
always_build_mir: bool = (false, parse_bool,
589+
"Always build MIR for all fns, even without a #[rustc_mir] annotation"),
586590
no_analysis: bool = (false, parse_bool,
587591
"Parse and expand the source, but run no analysis"),
588592
extra_plugins: Vec<String> = (Vec::new(), parse_list,
@@ -894,6 +898,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
894898
let parse_only = debugging_opts.parse_only;
895899
let no_trans = debugging_opts.no_trans;
896900
let treat_err_as_bug = debugging_opts.treat_err_as_bug;
901+
let always_build_mir = debugging_opts.always_build_mir;
897902
let no_analysis = debugging_opts.no_analysis;
898903

899904
if debugging_opts.debug_llvm {
@@ -1049,6 +1054,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10491054
parse_only: parse_only,
10501055
no_trans: no_trans,
10511056
treat_err_as_bug: treat_err_as_bug,
1057+
always_build_mir: always_build_mir,
10521058
no_analysis: no_analysis,
10531059
debugging_opts: debugging_opts,
10541060
write_dependency_info: write_dependency_info,

0 commit comments

Comments
 (0)