about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-02-07 19:50:03 -0800
committerbors <bors@rust-lang.org>2013-02-07 19:50:03 -0800
commite8fc4b347d3526d1adb21a5ff184c032fa2982c1 (patch)
tree2d8b91f3cdcc8d130d72a125882313c155bdce0a
parentbc1fb62c343639f9ac66cb0017b8c1813d5e06a7 (diff)
parentfae8fc94dc893c7a08a49941da3568a2ae673a47 (diff)
auto merge of #4834 : veddan/rust/zflags, r=graydon
Converted --static, --gc, --jit, -g and --xg to -Z flags.
-rw-r--r--src/librustc/driver/driver.rs19
-rw-r--r--src/librustc/driver/session.rs12
2 files changed, 18 insertions, 13 deletions
diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs
index 5b7dc75bec6..4273f4f135b 100644
--- a/src/librustc/driver/driver.rs
+++ b/src/librustc/driver/driver.rs
@@ -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(),
@@ -714,14 +714,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"),
@@ -741,13 +738,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"),
diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs
index ce71ee87c9e..cb55051c57f 100644
--- a/src/librustc/driver/session.rs
+++ b/src/librustc/driver/session.rs
@@ -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),
@@ -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)
     ]
 }