Skip to content

Issue #4740 #4834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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;
pub const gc: uint = 1 << 18;
pub const jit: uint = 1 << 19;
pub const debug_info: uint = 1 << 20;
pub const extra_debug_info: uint = 1 << 21;
pub 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