]> git.lizzy.rs Git - rust.git/commitdiff
Move tls-model to a -Z option since it is unstable
authorAmanieu d'Antras <amanieu@gmail.com>
Mon, 6 Nov 2017 21:10:49 +0000 (21:10 +0000)
committerAmanieu d'Antras <amanieu@gmail.com>
Mon, 6 Nov 2017 21:10:49 +0000 (21:10 +0000)
src/librustc/session/config.rs
src/librustc_trans/context.rs

index d1d04e883b8fd0e7620eae2ddf1b3d89dac84c02..558761256d2a98121c6ffa4f01bd3cfbfc7d63ba 100644 (file)
@@ -911,8 +911,6 @@ fn parse_optimization_fuel(slot: &mut Option<(String, u64)>, v: Option<&str>) ->
          "choose the relocation model to use (rustc --print relocation-models for details)"),
     code_model: Option<String> = (None, parse_opt_string, [TRACKED],
          "choose the code model to use (rustc --print code-models for details)"),
-    tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
-         "choose the TLS model to use (rustc --print tls-models for details)"),
     metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
          "metadata to mangle symbol names with"),
     extra_filename: String = ("".to_string(), parse_string, [UNTRACKED],
@@ -1107,6 +1105,8 @@ fn parse_optimization_fuel(slot: &mut Option<(String, u64)>, v: Option<&str>) ->
         "enable ThinLTO when possible"),
     inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
         "control whether #[inline] functions are in all cgus"),
+    tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
+         "choose the TLS model to use (rustc --print tls-models for details)"),
 }
 
 pub fn default_lib_output() -> CrateType {
@@ -1475,7 +1475,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
         })
     });
 
-    let debugging_opts = build_debugging_options(matches, error_format);
+    let mut debugging_opts = build_debugging_options(matches, error_format);
 
     let mut output_types = BTreeMap::new();
     if !debugging_opts.parse_only {
@@ -1576,9 +1576,9 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
         prints.push(PrintRequest::CodeModels);
         cg.code_model = None;
     }
-    if cg.tls_model.as_ref().map_or(false, |s| s == "help") {
+    if debugging_opts.tls_model.as_ref().map_or(false, |s| s == "help") {
         prints.push(PrintRequest::TlsModels);
-        cg.tls_model = None;
+        debugging_opts.tls_model = None;
     }
 
     let cg = cg;
@@ -2523,7 +2523,7 @@ fn test_codegen_options_tracking_hash() {
         assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
 
         opts = reference.clone();
-        opts.cg.tls_model = Some(String::from("tls model"));
+        opts.debugging_opts.tls_model = Some(String::from("tls model"));
         assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
 
         opts = reference.clone();
index 0089dd67121cb0b9e7d0d6e5cc43cb4497c79951..cb71ef104d3d9424fc0310c63c3da083f5636d1b 100644 (file)
@@ -168,7 +168,7 @@ pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
 }
 
 fn get_tls_model(sess: &Session) -> llvm::ThreadLocalMode {
-    let tls_model_arg = match sess.opts.cg.tls_model {
+    let tls_model_arg = match sess.opts.debugging_opts.tls_model {
         Some(ref s) => &s[..],
         None => &sess.target.target.options.tls_model[..],
     };