Skip to content

Commit a5d5f9e

Browse files
committed
rustc: Add a --gc switch for debugging and experimentation
1 parent c5c8258 commit a5d5f9e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/comp/driver/rustc.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ options:
279279
--no-typestate don't run the typestate pass (unsafe!)
280280
--test build test harness
281281
--dps translate via destination-passing style (experimental)
282+
--gc garbage collect shared data (experimental/temporary)
282283
283284
");
284285
}
@@ -385,6 +386,7 @@ fn build_session_options(binary: str, match: getopts::match, binary_dir: str)
385386
let cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg"));
386387
let test = opt_present(match, "test");
387388
let dps = opt_present(match, "dps");
389+
let do_gc = opt_present(match, "gc");
388390
let sopts: @session::options =
389391
@{library: library,
390392
static: static,
@@ -403,7 +405,8 @@ fn build_session_options(binary: str, match: getopts::match, binary_dir: str)
403405
test: test,
404406
dps: dps,
405407
parse_only: parse_only,
406-
no_trans: no_trans};
408+
no_trans: no_trans,
409+
do_gc: do_gc};
407410
ret sopts;
408411
}
409412

@@ -435,7 +438,7 @@ fn opts() -> vec[getopts::opt] {
435438
optopt("sysroot"), optflag("stats"), optflag("time-passes"),
436439
optflag("time-llvm-passes"), optflag("no-typestate"),
437440
optflag("noverify"), optmulti("cfg"), optflag("test"),
438-
optflag("lib"), optflag("static"), optflag("dps")];
441+
optflag("lib"), optflag("static"), optflag("dps"), optflag("gc")];
439442
}
440443

441444
fn main(args: vec[str]) {

src/comp/driver/session.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ type options =
4343
test: bool,
4444
dps: bool,
4545
parse_only: bool,
46-
no_trans: bool
46+
no_trans: bool,
47+
do_gc: bool
4748
};
4849

4950
type crate_metadata = {name: str, data: [u8]};

0 commit comments

Comments
 (0)