Moved experimental compiler flags to -Z (#4740)

This commit is contained in:
Viktor Dahl 2013-02-08 00:14:17 +01:00
parent 6e9298ab88
commit b8943474dc
2 changed files with 18 additions and 13 deletions

View File

@ -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");
@ -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
@ -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");
@ -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(),
@ -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"),
@ -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"),

View File

@ -75,6 +75,11 @@ pub enum crate_type { bin_crate, lib_crate, unknown_crate, }
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),
@ -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)
]
}