From a5d5f9ef4871d5340f8a7820309ed6ea97648058 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 10 Aug 2011 22:12:42 -0700 Subject: [PATCH] rustc: Add a --gc switch for debugging and experimentation --- src/comp/driver/rustc.rs | 7 +++++-- src/comp/driver/session.rs | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 9b71fc25ceb9..3b0cecb82ea1 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -279,6 +279,7 @@ options: --no-typestate don't run the typestate pass (unsafe!) --test build test harness --dps translate via destination-passing style (experimental) + --gc garbage collect shared data (experimental/temporary) "); } @@ -385,6 +386,7 @@ fn build_session_options(binary: str, match: getopts::match, binary_dir: str) let cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg")); let test = opt_present(match, "test"); let dps = opt_present(match, "dps"); + let do_gc = opt_present(match, "gc"); let sopts: @session::options = @{library: library, static: static, @@ -403,7 +405,8 @@ fn build_session_options(binary: str, match: getopts::match, binary_dir: str) test: test, dps: dps, parse_only: parse_only, - no_trans: no_trans}; + no_trans: no_trans, + do_gc: do_gc}; ret sopts; } @@ -435,7 +438,7 @@ fn opts() -> vec[getopts::opt] { optopt("sysroot"), optflag("stats"), optflag("time-passes"), optflag("time-llvm-passes"), optflag("no-typestate"), optflag("noverify"), optmulti("cfg"), optflag("test"), - optflag("lib"), optflag("static"), optflag("dps")]; + optflag("lib"), optflag("static"), optflag("dps"), optflag("gc")]; } fn main(args: vec[str]) { diff --git a/src/comp/driver/session.rs b/src/comp/driver/session.rs index ebb9672374cb..64de0033ce46 100644 --- a/src/comp/driver/session.rs +++ b/src/comp/driver/session.rs @@ -43,7 +43,8 @@ type options = test: bool, dps: bool, parse_only: bool, - no_trans: bool + no_trans: bool, + do_gc: bool }; type crate_metadata = {name: str, data: [u8]};