Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Moved experimental compiler flags to -Z (#4740)
  • Loading branch information
veddan committed Feb 7, 2013
1 parent 6e9298a commit b894347
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/librustc/driver/driver.rs
Expand Up @@ -521,9 +521,6 @@ pub fn build_session_options(+binary: ~str,
} else {
session::unknown_crate
};
let static = opt_present(matches, ~"static");
let gc = opt_present(matches, ~"gc");

let parse_only = opt_present(matches, ~"parse-only");
let no_trans = opt_present(matches, ~"no-trans");

Expand Down Expand Up @@ -570,7 +567,6 @@ pub fn build_session_options(+binary: ~str,
}
}

let jit = opt_present(matches, ~"jit");
let output_type =
if parse_only || no_trans {
link::output_type_none
Expand All @@ -584,8 +580,6 @@ pub fn build_session_options(+binary: ~str,
} else if opt_present(matches, ~"emit-llvm") {
link::output_type_bitcode
} else { link::output_type_exe };
let extra_debuginfo = opt_present(matches, ~"xg");
let debuginfo = opt_present(matches, ~"g") || extra_debuginfo;
let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
let sysroot_opt = sysroot_opt.map(|m| Path(*m));
let target_opt = getopts::opt_maybe_str(matches, ~"target");
Expand Down Expand Up @@ -616,6 +610,12 @@ pub fn build_session_options(+binary: ~str,
}
} else { No }
};
let gc = debugging_opts & session::gc != 0;
let jit = debugging_opts & session::jit != 0;
let extra_debuginfo = debugging_opts & session::extra_debug_info != 0;
let debuginfo = debugging_opts & session::debug_info != 0 ||
extra_debuginfo;
let static = debugging_opts & session::static != 0;
let target =
match target_opt {
None => host_triple(),
Expand Down Expand Up @@ -712,14 +712,11 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
environment", ~"SPEC"),
optflag(~"", ~"emit-llvm",
~"Produce an LLVM bitcode file"),
optflag(~"g", ~"", ~"Produce debug info (experimental)"),
optflag(~"", ~"gc", ~"Garbage collect shared data (experimental)"),
optflag(~"h", ~"help",~"Display this message"),
optmulti(~"L", ~"", ~"Add a directory to the library search path",
~"PATH"),
optflag(~"", ~"lib", ~"Compile a library crate"),
optflag(~"", ~"ls", ~"List the symbols defined by a library crate"),
optflag(~"", ~"jit", ~"Execute using JIT (experimental)"),
optflag(~"", ~"no-trans",
~"Run all passes except translation; no output"),
optflag(~"O", ~"", ~"Equivalent to --opt-level=2"),
Expand All @@ -739,13 +736,9 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
or identified (fully parenthesized,
AST nodes and blocks with IDs)", ~"TYPE"),
optflag(~"S", ~"", ~"Compile only; do not assemble or link"),
optflag(~"", ~"xg", ~"Extra debugging info (experimental)"),
optflag(~"", ~"save-temps",
~"Write intermediate files (.bc, .opt.bc, .o)
in addition to normal output"),
optflag(~"", ~"static",
~"Use or produce static libraries or binaries
(experimental)"),
optopt(~"", ~"sysroot",
~"Override the system root", ~"PATH"),
optflag(~"", ~"test", ~"Build a test harness"),
Expand Down
12 changes: 12 additions & 0 deletions src/librustc/driver/session.rs
Expand Up @@ -75,6 +75,11 @@ pub const count_type_sizes: uint = 1 << 14;
pub const meta_stats: uint = 1 << 15;
pub const no_opt: uint = 1 << 16;
pub const no_monomorphic_collapse: uint = 1 << 17;
const gc: uint = 1 << 18;
const jit: uint = 1 << 19;
const debug_info: uint = 1 << 20;
const extra_debug_info: uint = 1 << 21;
const static: uint = 1 << 22;

pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
Expand Down Expand Up @@ -102,6 +107,13 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
(~"no-opt", ~"do not optimize, even if -O is passed", no_opt),
(~"no-monomorphic-collapse", ~"do not collapse template instantiations",
no_monomorphic_collapse),
(~"gc", ~"Garbage collect shared data (experimental)", gc),
(~"jit", ~"Execute using JIT (experimental)", jit),
(~"extra-debug-info", ~"Extra debugging info (experimental)",
extra_debug_info),
(~"debug-info", ~"Produce debug info (experimental)", debug_info),
(~"static", ~"Use or produce static libraries or binaries " +
"(experimental)", static)
]
}

Expand Down

0 comments on commit b894347

Please sign in to comment.