]> git.lizzy.rs Git - rust.git/commitdiff
librustc::session : Make DebuggingOpts use the options! macro
authorManish Goregaokar <manishsmail@gmail.com>
Tue, 9 Dec 2014 09:55:49 +0000 (15:25 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 8 Jan 2015 08:08:43 +0000 (13:38 +0530)
src/librustc/middle/infer/region_inference/graphviz.rs
src/librustc/session/config.rs
src/librustc/session/mod.rs
src/librustc_borrowck/borrowck/fragments.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_driver/pretty.rs
src/librustc_driver/test.rs
src/librustc_trans/back/link.rs
src/librustc_trans/back/write.rs

index 29feaf358e2e259795cef71f9505b386b5e92fe4..0d6ab9c273b754a7e3491ca8568a9312adb86158 100644 (file)
@@ -22,7 +22,6 @@
 use super::Constraint;
 use middle::infer::SubregionOrigin;
 use middle::infer::region_inference::RegionVarBindings;
-use session::config;
 use util::nodemap::{FnvHashMap, FnvHashSet};
 use util::ppaux::Repr;
 
@@ -55,7 +54,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(region_vars: &RegionVarBindings<'a,
                                              subject_node: ast::NodeId) {
     let tcx = region_vars.tcx;
 
-    if !region_vars.tcx.sess.debugging_opt(config::PRINT_REGION_GRAPH) {
+    if !region_vars.tcx.sess.opts.debugging_opts.print_region_graph {
         return;
     }
 
index a108982f031247f272b608a41def4c25d5a04bb3..ca24c1f56a091f24a5fe28fdb4c7470acf12d9bc 100644 (file)
@@ -99,7 +99,7 @@ pub struct Options {
     pub parse_only: bool,
     pub no_trans: bool,
     pub no_analysis: bool,
-    pub debugging_opts: u64,
+    pub debugging_opts: DebuggingOptions,
     /// Whether to write dependency files. It's (enabled, optional filename).
     pub write_dependency_info: (bool, Option<Path>),
     pub prints: Vec<PrintRequest>,
@@ -224,7 +224,7 @@ pub fn basic_options() -> Options {
         parse_only: false,
         no_trans: false,
         no_analysis: false,
-        debugging_opts: 0,
+        debugging_opts: basic_debugging_options(),
         write_dependency_info: (false, None),
         prints: Vec::new(),
         cg: basic_codegen_options(),
@@ -257,103 +257,6 @@ pub enum CrateType {
     CrateTypeStaticlib,
 }
 
-macro_rules! debugging_opts {
-    ([ $opt:ident ] $cnt:expr ) => (
-        pub const $opt: u64 = 1 << $cnt;
-    );
-    ([ $opt:ident, $($rest:ident),* ] $cnt:expr ) => (
-        pub const $opt: u64 = 1 << $cnt;
-        debugging_opts! { [ $($rest),* ] $cnt + 1 }
-    )
-}
-
-debugging_opts! {
-    [
-        VERBOSE,
-        TIME_PASSES,
-        COUNT_LLVM_INSNS,
-        TIME_LLVM_PASSES,
-        TRANS_STATS,
-        ASM_COMMENTS,
-        NO_VERIFY,
-        BORROWCK_STATS,
-        NO_LANDING_PADS,
-        DEBUG_LLVM,
-        COUNT_TYPE_SIZES,
-        META_STATS,
-        GC,
-        PRINT_LINK_ARGS,
-        PRINT_LLVM_PASSES,
-        AST_JSON,
-        AST_JSON_NOEXPAND,
-        LS,
-        SAVE_ANALYSIS,
-        PRINT_MOVE_FRAGMENTS,
-        FLOWGRAPH_PRINT_LOANS,
-        FLOWGRAPH_PRINT_MOVES,
-        FLOWGRAPH_PRINT_ASSIGNS,
-        FLOWGRAPH_PRINT_ALL,
-        PRINT_REGION_GRAPH,
-        PARSE_ONLY,
-        NO_TRANS,
-        NO_ANALYSIS,
-        UNSTABLE_OPTIONS,
-        PRINT_ENUM_SIZES
-    ]
-    0
-}
-
-pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
-    vec![("verbose", "in general, enable more debug printouts", VERBOSE),
-     ("time-passes", "measure time of each rustc pass", TIME_PASSES),
-     ("count-llvm-insns", "count where LLVM \
-                           instrs originate", COUNT_LLVM_INSNS),
-     ("time-llvm-passes", "measure time of each LLVM pass",
-      TIME_LLVM_PASSES),
-     ("trans-stats", "gather trans statistics", TRANS_STATS),
-     ("asm-comments", "generate comments into the assembly (may change behavior)",
-      ASM_COMMENTS),
-     ("no-verify", "skip LLVM verification", NO_VERIFY),
-     ("borrowck-stats", "gather borrowck statistics",  BORROWCK_STATS),
-     ("no-landing-pads", "omit landing pads for unwinding",
-      NO_LANDING_PADS),
-     ("debug-llvm", "enable debug output from LLVM", DEBUG_LLVM),
-     ("count-type-sizes", "count the sizes of aggregate types",
-      COUNT_TYPE_SIZES),
-     ("meta-stats", "gather metadata statistics", META_STATS),
-     ("print-link-args", "Print the arguments passed to the linker",
-      PRINT_LINK_ARGS),
-     ("gc", "Garbage collect shared data (experimental)", GC),
-     ("print-llvm-passes",
-      "Prints the llvm optimization passes being run",
-      PRINT_LLVM_PASSES),
-     ("ast-json", "Print the AST as JSON and halt", AST_JSON),
-     ("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
-     ("ls", "List the symbols defined by a library crate", LS),
-     ("save-analysis", "Write syntax and type analysis information \
-                        in addition to normal output", SAVE_ANALYSIS),
-     ("print-move-fragments", "Print out move-fragment data for every fn",
-      PRINT_MOVE_FRAGMENTS),
-     ("flowgraph-print-loans", "Include loan analysis data in \
-                       --pretty flowgraph output", FLOWGRAPH_PRINT_LOANS),
-     ("flowgraph-print-moves", "Include move analysis data in \
-                       --pretty flowgraph output", FLOWGRAPH_PRINT_MOVES),
-     ("flowgraph-print-assigns", "Include assignment analysis data in \
-                       --pretty flowgraph output", FLOWGRAPH_PRINT_ASSIGNS),
-     ("flowgraph-print-all", "Include all dataflow analysis data in \
-                       --pretty flowgraph output", FLOWGRAPH_PRINT_ALL),
-     ("print-region-graph", "Prints region inference graph. \
-                             Use with RUST_REGION_GRAPH=help for more info",
-      PRINT_REGION_GRAPH),
-     ("parse-only", "Parse only; do not compile, assemble, or link", PARSE_ONLY),
-     ("no-trans", "Run all passes except translation; no output", NO_TRANS),
-     ("no-analysis", "Parse and expand the source, but run no analysis and",
-      NO_ANALYSIS),
-     ("unstable-options", "Adds unstable command line options to rustc interface",
-      UNSTABLE_OPTIONS),
-     ("print-enum-sizes", "Print the size of enums and their variants", PRINT_ENUM_SIZES),
-    ]
-}
 
 #[derive(Clone)]
 pub enum Passes {
@@ -387,6 +290,7 @@ macro_rules! options {
      $($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
 (
     #[derive(Clone)]
+    #[allow(missing_copy_implementations)]
     pub struct $struct_name { $(pub $opt: $t),* }
 
     pub fn $defaultfn() -> $struct_name {
@@ -439,7 +343,7 @@ pub fn $buildfn(matches: &getopts::Matches) -> $struct_name
                                      Option<&'static str>, &'static str)] =
         &[ $( (stringify!($opt), $mod_set::$opt, $mod_desc::$parse, $desc) ),* ];
 
-    #[allow(non_upper_case_globals)]
+    #[allow(non_upper_case_globals, dead_code)]
     mod $mod_desc {
         pub const parse_bool: Option<&'static str> = None;
         pub const parse_opt_bool: Option<&'static str> = None;
@@ -454,6 +358,7 @@ mod $mod_desc {
             Some("a number");
     }
 
+    #[allow(dead_code)]
     mod $mod_set {
         use super::{$struct_name, Passes, SomePasses, AllPasses};
 
@@ -608,6 +513,73 @@ fn parse_passes(slot: &mut Passes, v: Option<&str>) -> bool {
         "Optimize with possible levels 0-3"),
 }
 
+
+options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
+         build_debugging_options, "Z", "debugging",
+         DB_OPTIONS, db_type_desc, dbsetters,
+    verbose: bool = (false, parse_bool,
+        "in general, enable more debug printouts"),
+    time_passes: bool = (false, parse_bool,
+        "measure time of each rustc pass"),
+    count_llvm_insns: bool = (false, parse_bool,
+        "count where LLVM instrs originate"),
+    time_llvm_passes: bool = (false, parse_bool,
+        "measure time of each LLVM pass"),
+    trans_stats: bool = (false, parse_bool,
+        "gather trans statistics"),
+    asm_comments: bool = (false, parse_bool,
+        "generate comments into the assembly (may change behavior)"),
+    no_verify: bool = (false, parse_bool,
+        "skip LLVM verification"),
+    borrowck_stats: bool = (false, parse_bool,
+        "gather borrowck statistics"),
+    no_landing_pads: bool = (false, parse_bool,
+        "omit landing pads for unwinding"),
+    debug_llvm: bool = (false, parse_bool,
+        "enable debug output from LLVM"),
+    count_type_sizes: bool = (false, parse_bool,
+        "count the sizes of aggregate types"),
+    meta_stats: bool = (false, parse_bool,
+        "gather metadata statistics"),
+    print_link_args: bool = (false, parse_bool,
+        "Print the arguments passed to the linker"),
+    gc: bool = (false, parse_bool,
+        "Garbage collect shared data (experimental)"),
+    print_llvm_passes: bool = (false, parse_bool,
+        "Prints the llvm optimization passes being run"),
+    ast_json: bool = (false, parse_bool,
+        "Print the AST as JSON and halt"),
+    ast_json_noexpand: bool = (false, parse_bool,
+        "Print the pre-expansion AST as JSON and halt"),
+    ls: bool = (false, parse_bool,
+        "List the symbols defined by a library crate"),
+    save_analysis: bool = (false, parse_bool,
+        "Write syntax and type analysis information in addition to normal output"),
+    print_move_fragments: bool = (false, parse_bool,
+        "Print out move-fragment data for every fn"),
+    flowgraph_print_loans: bool = (false, parse_bool,
+        "Include loan analysis data in --pretty flowgraph output"),
+    flowgraph_print_moves: bool = (false, parse_bool,
+        "Include move analysis data in --pretty flowgraph output"),
+    flowgraph_print_assigns: bool = (false, parse_bool,
+        "Include assignment analysis data in --pretty flowgraph output"),
+    flowgraph_print_all: bool = (false, parse_bool,
+        "Include all dataflow analysis data in --pretty flowgraph output"),
+    print_region_graph: bool = (false, parse_bool,
+         "Prints region inference graph. \
+          Use with RUST_REGION_GRAPH=help for more info"),
+    parse_only: bool = (false, parse_bool,
+          "Parse only; do not compile, assemble, or link"),
+    no_trans: bool = (false, parse_bool,
+          "Run all passes except translation; no output"),
+    no_analysis: bool = (false, parse_bool,
+          "Parse and expand the source, but run no analysis"),
+    unstable_options: bool = (false, parse_bool,
+          "Adds unstable command line options to rustc interface"),
+    print_enum_sizes: bool = (false, parse_bool,
+          "Print the size of enums and their variants"),
+}
+
 pub fn default_lib_output() -> CrateType {
     CrateTypeRlib
 }
@@ -883,52 +855,36 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
         }
     }
 
-    let mut debugging_opts = 0;
-    let debug_flags = matches.opt_strs("Z");
-    let debug_map = debugging_opts_map();
-    for debug_flag in debug_flags.iter() {
-        let mut this_bit = 0;
-        for &(name, _, bit) in debug_map.iter() {
-            if name == *debug_flag {
-                this_bit = bit;
-                break;
-            }
-        }
-        if this_bit == 0 {
-            early_error(&format!("unknown debug flag: {}",
-                                *debug_flag)[])
-        }
-        debugging_opts |= this_bit;
-    }
+    let debugging_opts = build_debugging_options(matches);
 
     let parse_only = if matches.opt_present("parse-only") {
         // FIXME(acrichto) remove this eventually
         early_warn("--parse-only is deprecated in favor of -Z parse-only");
         true
     } else {
-        debugging_opts & PARSE_ONLY != 0
+        debugging_opts.parse_only
     };
     let no_trans = if matches.opt_present("no-trans") {
         // FIXME(acrichto) remove this eventually
         early_warn("--no-trans is deprecated in favor of -Z no-trans");
         true
     } else {
-        debugging_opts & NO_TRANS != 0
+        debugging_opts.no_trans
     };
     let no_analysis = if matches.opt_present("no-analysis") {
         // FIXME(acrichto) remove this eventually
         early_warn("--no-analysis is deprecated in favor of -Z no-analysis");
         true
     } else {
-        debugging_opts & NO_ANALYSIS != 0
+        debugging_opts.no_analysis
     };
 
-    if debugging_opts & DEBUG_LLVM != 0 {
+    if debugging_opts.debug_llvm {
         unsafe { llvm::LLVMSetDebug(1); }
     }
 
     let mut output_types = Vec::new();
-    if !parse_only && !no_trans {
+    if !debugging_opts.parse_only && !no_trans {
         let unparsed_output_types = matches.opt_strs("emit");
         for unparsed_output_type in unparsed_output_types.iter() {
             for part in unparsed_output_type.split(',') {
@@ -998,7 +954,7 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
             }
         }
     };
-    let gc = debugging_opts & GC != 0;
+    let gc = debugging_opts.gc;
     let debuginfo = if matches.opt_present("g") {
         if matches.opt_present("debuginfo") {
             early_error("-g and --debuginfo both provided");
index 65dac1a5fac886ed8d6b7d72459ff49e1122d5a8..79e4d0f7aea3011c750f380f7d6d842dcb22c7c7 100644 (file)
@@ -164,9 +164,6 @@ pub fn reserve_node_ids(&self, count: ast::NodeId) -> ast::NodeId {
     pub fn diagnostic<'a>(&'a self) -> &'a diagnostic::SpanHandler {
         &self.parse_sess.span_diagnostic
     }
-    pub fn debugging_opt(&self, opt: u64) -> bool {
-        (self.opts.debugging_opts & opt) != 0
-    }
     pub fn codemap<'a>(&'a self) -> &'a codemap::CodeMap {
         &self.parse_sess.span_diagnostic.cm
     }
@@ -176,36 +173,36 @@ pub fn impossible_case(&self, sp: Span, msg: &str) -> ! {
         self.span_bug(sp,
                       &format!("impossible case reached: {}", msg)[]);
     }
-    pub fn verbose(&self) -> bool { self.debugging_opt(config::VERBOSE) }
-    pub fn time_passes(&self) -> bool { self.debugging_opt(config::TIME_PASSES) }
+    pub fn verbose(&self) -> bool { self.opts.debugging_opts.verbose }
+    pub fn time_passes(&self) -> bool { self.opts.debugging_opts.time_passes }
     pub fn count_llvm_insns(&self) -> bool {
-        self.debugging_opt(config::COUNT_LLVM_INSNS)
+        self.opts.debugging_opts.count_llvm_insns
     }
     pub fn count_type_sizes(&self) -> bool {
-        self.debugging_opt(config::COUNT_TYPE_SIZES)
+        self.opts.debugging_opts.count_type_sizes
     }
     pub fn time_llvm_passes(&self) -> bool {
-        self.debugging_opt(config::TIME_LLVM_PASSES)
+        self.opts.debugging_opts.time_llvm_passes
     }
-    pub fn trans_stats(&self) -> bool { self.debugging_opt(config::TRANS_STATS) }
-    pub fn meta_stats(&self) -> bool { self.debugging_opt(config::META_STATS) }
-    pub fn asm_comments(&self) -> bool { self.debugging_opt(config::ASM_COMMENTS) }
-    pub fn no_verify(&self) -> bool { self.debugging_opt(config::NO_VERIFY) }
-    pub fn borrowck_stats(&self) -> bool { self.debugging_opt(config::BORROWCK_STATS) }
+    pub fn trans_stats(&self) -> bool { self.opts.debugging_opts.trans_stats }
+    pub fn meta_stats(&self) -> bool { self.opts.debugging_opts.meta_stats }
+    pub fn asm_comments(&self) -> bool { self.opts.debugging_opts.asm_comments }
+    pub fn no_verify(&self) -> bool { self.opts.debugging_opts.no_verify }
+    pub fn borrowck_stats(&self) -> bool { self.opts.debugging_opts.borrowck_stats }
     pub fn print_llvm_passes(&self) -> bool {
-        self.debugging_opt(config::PRINT_LLVM_PASSES)
+        self.opts.debugging_opts.print_llvm_passes
     }
     pub fn lto(&self) -> bool {
         self.opts.cg.lto
     }
     pub fn no_landing_pads(&self) -> bool {
-        self.debugging_opt(config::NO_LANDING_PADS)
+        self.opts.debugging_opts.no_landing_pads
     }
     pub fn unstable_options(&self) -> bool {
-        self.debugging_opt(config::UNSTABLE_OPTIONS)
+        self.opts.debugging_opts.unstable_options
     }
     pub fn print_enum_sizes(&self) -> bool {
-        self.debugging_opt(config::PRINT_ENUM_SIZES)
+        self.opts.debugging_opts.print_enum_sizes
     }
     pub fn sysroot<'a>(&'a self) -> &'a Path {
         match self.opts.maybe_sysroot {
index 1b1202082177112e35ba939fa52196442f8d111c..e2942719f2a47882993837ffdb0f619f74bc81aa 100644 (file)
@@ -19,7 +19,6 @@
 use borrowck::LoanPathElem::{LpDeref, LpInterior};
 use borrowck::move_data::{InvalidMovePathIndex};
 use borrowck::move_data::{MoveData, MovePathIndex};
-use rustc::session::config;
 use rustc::middle::ty;
 use rustc::middle::mem_categorization as mc;
 use rustc::util::ppaux::{Repr, UserString};
@@ -133,7 +132,7 @@ pub fn instrument_move_fragments<'tcx>(this: &MoveData<'tcx>,
 
         let span_err =
             attrs.iter().any(|a| a.check_name("rustc_move_fragments"));
-        let print = tcx.sess.debugging_opt(config::PRINT_MOVE_FRAGMENTS);
+        let print = tcx.sess.opts.debugging_opts.print_move_fragments;
 
         (span_err, print)
     };
index 019691c1e1027bc7c55fd914030fd21607efd77e..c5ade686dfb4607747d594e3fd48988f7320aca1 100644 (file)
@@ -142,7 +142,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
         }
     });
 
-    if sess.opts.debugging_opts & config::AST_JSON_NOEXPAND != 0 {
+    if sess.opts.debugging_opts.ast_json_noexpand {
         println!("{}", json::as_json(&krate));
     }
 
@@ -334,7 +334,7 @@ fn new_id(&self, old_id: ast::NodeId) -> ast::NodeId {
     let map = time(sess.time_passes(), "assigning node ids and indexing ast", forest, |forest|
                    ast_map::map_crate(forest, NodeIdAssigner { sess: sess }));
 
-    if sess.opts.debugging_opts & config::AST_JSON != 0 {
+    if sess.opts.debugging_opts.ast_json {
         println!("{}", json::as_json(map.krate()));
     }
 
@@ -484,7 +484,7 @@ pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
 }
 
 fn save_analysis(sess: &Session) -> bool {
-    (sess.opts.debugging_opts & config::SAVE_ANALYSIS) != 0
+    sess.opts.debugging_opts.save_analysis
 }
 
 pub fn phase_save_analysis(sess: &Session,
@@ -575,7 +575,7 @@ pub fn stop_after_phase_1(sess: &Session) -> bool {
     if sess.opts.show_span.is_some() {
         return true;
     }
-    return sess.opts.debugging_opts & config::AST_JSON_NOEXPAND != 0;
+    return sess.opts.debugging_opts.ast_json_noexpand;
 }
 
 pub fn stop_after_phase_2(sess: &Session) -> bool {
@@ -583,7 +583,7 @@ pub fn stop_after_phase_2(sess: &Session) -> bool {
         debug!("invoked with --no-analysis, returning early from compile_input");
         return true;
     }
-    return sess.opts.debugging_opts & config::AST_JSON != 0;
+    return sess.opts.debugging_opts.ast_json;
 }
 
 pub fn stop_after_phase_5(sess: &Session) -> bool {
index 27e1eaacdfd993d2798c0ac7218269f4707c1f93..c4ecb6b7b0634fab03020811676756f3b9496022 100644 (file)
@@ -378,13 +378,13 @@ fn sort_lint_groups(lints: Vec<(&'static str, Vec<lint::LintId>, bool)>)
 
 fn describe_debug_flags() {
     println!("\nAvailable debug options:\n");
-    let r = config::debugging_opts_map();
-    for tuple in r.iter() {
-        match *tuple {
-            (ref name, ref desc, _) => {
-                println!("    -Z {:>20} -- {}", *name, *desc);
-            }
-        }
+    for &(name, _, opt_type_desc, desc) in config::DB_OPTIONS.iter() {
+        let (width, extra) = match opt_type_desc {
+            Some(..) => (21, "=val"),
+            None => (25, "")
+        };
+        println!("    -Z {:>width$}{} -- {}", name.replace("_", "-"),
+                 extra, desc, width=width);
     }
 }
 
index 7592fbc05b3383afcf52457473095e2cec1d1f27..1765c80f9437b45b28807545f10e62f8e5f46a7a 100644 (file)
@@ -23,7 +23,7 @@
 use rustc::middle::cfg;
 use rustc::middle::cfg::graphviz::LabelledCFG;
 use rustc::session::Session;
-use rustc::session::config::{self, Input};
+use rustc::session::config::Input;
 use rustc::util::ppaux;
 use rustc_borrowck as borrowck;
 use rustc_borrowck::graphviz as borrowck_dot;
@@ -305,19 +305,18 @@ fn post(&self,
 }
 
 fn gather_flowgraph_variants(sess: &Session) -> Vec<borrowck_dot::Variant> {
-    let print_loans   = config::FLOWGRAPH_PRINT_LOANS;
-    let print_moves   = config::FLOWGRAPH_PRINT_MOVES;
-    let print_assigns = config::FLOWGRAPH_PRINT_ASSIGNS;
-    let print_all     = config::FLOWGRAPH_PRINT_ALL;
-    let opt = |&: print_which| sess.debugging_opt(print_which);
+    let print_loans = sess.opts.debugging_opts.flowgraph_print_loans;
+    let print_moves = sess.opts.debugging_opts.flowgraph_print_moves;
+    let print_assigns = sess.opts.debugging_opts.flowgraph_print_assigns;
+    let print_all = sess.opts.debugging_opts.flowgraph_print_all;
     let mut variants = Vec::new();
-    if opt(print_all) || opt(print_loans) {
+    if print_all || print_loans {
         variants.push(borrowck_dot::Loans);
     }
-    if opt(print_all) || opt(print_moves) {
+    if print_all || print_moves {
         variants.push(borrowck_dot::Moves);
     }
-    if opt(print_all) || opt(print_assigns) {
+    if print_all || print_assigns {
         variants.push(borrowck_dot::Assigns);
     }
     variants
index a798ec9aaf76059c00087c6995507597410ac8e6..f68c76f4c44243dc455c912538db7f0e8486716c 100644 (file)
@@ -99,7 +99,7 @@ fn test_env<F>(source_string: &str,
 {
     let mut options =
         config::basic_options();
-    options.debugging_opts |= config::VERBOSE;
+    options.debugging_opts.verbose = true;
     let codemap =
         CodeMap::new();
     let diagnostic_handler =
index 43f8c677e303bfd6c80476f6adde4a4c0bdf213a..351be70cf52614497b11564c976209cdd489af29 100644 (file)
@@ -778,7 +778,7 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
         cmd.arg("-lcompiler-rt");
     }
 
-    if (sess.opts.debugging_opts & config::PRINT_LINK_ARGS) != 0 {
+    if sess.opts.debugging_opts.print_link_args {
         println!("{}", &cmd);
     }
 
index e0ba6d569cc031cf7cabc5e82f85c3876635d1de..c818dda7581bd02aa32c737e21c5b7bada86f067 100644 (file)
@@ -715,7 +715,7 @@ pub fn run_passes(sess: &Session,
 
         cmd.args(&sess.target.target.options.post_link_args[]);
 
-        if (sess.opts.debugging_opts & config::PRINT_LINK_ARGS) != 0 {
+        if sess.opts.debugging_opts.print_link_args {
             println!("{}", &cmd);
         }