Skip to content

Commit fdf7ba2

Browse files
committed
Move tls-model to a -Z option since it is unstable
1 parent ad1bb2e commit fdf7ba2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc/session/config.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,6 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
911911
"choose the relocation model to use (rustc --print relocation-models for details)"),
912912
code_model: Option<String> = (None, parse_opt_string, [TRACKED],
913913
"choose the code model to use (rustc --print code-models for details)"),
914-
tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
915-
"choose the TLS model to use (rustc --print tls-models for details)"),
916914
metadata: Vec<String> = (Vec::new(), parse_list, [TRACKED],
917915
"metadata to mangle symbol names with"),
918916
extra_filename: String = ("".to_string(), parse_string, [UNTRACKED],
@@ -1107,6 +1105,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11071105
"enable ThinLTO when possible"),
11081106
inline_in_all_cgus: Option<bool> = (None, parse_opt_bool, [TRACKED],
11091107
"control whether #[inline] functions are in all cgus"),
1108+
tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
1109+
"choose the TLS model to use (rustc --print tls-models for details)"),
11101110
}
11111111

11121112
pub fn default_lib_output() -> CrateType {
@@ -1475,7 +1475,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14751475
})
14761476
});
14771477

1478-
let debugging_opts = build_debugging_options(matches, error_format);
1478+
let mut debugging_opts = build_debugging_options(matches, error_format);
14791479

14801480
let mut output_types = BTreeMap::new();
14811481
if !debugging_opts.parse_only {
@@ -1576,9 +1576,9 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
15761576
prints.push(PrintRequest::CodeModels);
15771577
cg.code_model = None;
15781578
}
1579-
if cg.tls_model.as_ref().map_or(false, |s| s == "help") {
1579+
if debugging_opts.tls_model.as_ref().map_or(false, |s| s == "help") {
15801580
prints.push(PrintRequest::TlsModels);
1581-
cg.tls_model = None;
1581+
debugging_opts.tls_model = None;
15821582
}
15831583

15841584
let cg = cg;
@@ -2523,7 +2523,7 @@ mod tests {
25232523
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
25242524

25252525
opts = reference.clone();
2526-
opts.cg.tls_model = Some(String::from("tls model"));
2526+
opts.debugging_opts.tls_model = Some(String::from("tls model"));
25272527
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
25282528

25292529
opts = reference.clone();

src/librustc_trans/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
168168
}
169169

170170
fn get_tls_model(sess: &Session) -> llvm::ThreadLocalMode {
171-
let tls_model_arg = match sess.opts.cg.tls_model {
171+
let tls_model_arg = match sess.opts.debugging_opts.tls_model {
172172
Some(ref s) => &s[..],
173173
None => &sess.target.target.options.tls_model[..],
174174
};

0 commit comments

Comments
 (0)