diff options
| author | est31 <MTest31@outlook.com> | 2020-10-15 11:44:00 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2020-10-15 12:02:24 +0200 |
| commit | 4fa55787745ac71793253c47c4d6cd5ffe96b741 (patch) | |
| tree | 46a7cad18bbfa0e1e87e39d1e80dcdfd04049f13 /compiler/rustc_codegen_llvm/src/llvm_util.rs | |
| parent | 0d1aa1e0346630189b779da0939e8138a8e6d668 (diff) | |
| download | rust-4fa55787745ac71793253c47c4d6cd5ffe96b741.tar.gz rust-4fa55787745ac71793253c47c4d6cd5ffe96b741.zip | |
Replace target.target with target and target.ptr_width with target.pointer_width
Preparation for a subsequent change that replaces
rustc_target::config::Config with its wrapped Target.
On its own, this commit breaks the build. I don't like making
build-breaking commits, but in this instance I believe that it
makes review easier, as the "real" changes of this PR can be
seen much more easily.
Result of running:
find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
./x.py fmt
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 88d73f2a864..9c1e1b8fac0 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -46,7 +46,7 @@ fn require_inited() { } unsafe fn configure_llvm(sess: &Session) { - let n_args = sess.opts.cg.llvm_args.len() + sess.target.target.options.llvm_args.len(); + let n_args = sess.opts.cg.llvm_args.len() + sess.target.options.llvm_args.len(); let mut llvm_c_strs = Vec::with_capacity(n_args + 1); let mut llvm_args = Vec::with_capacity(n_args + 1); @@ -57,7 +57,7 @@ unsafe fn configure_llvm(sess: &Session) { } let cg_opts = sess.opts.cg.llvm_args.iter(); - let tg_opts = sess.target.target.options.llvm_args.iter(); + let tg_opts = sess.target.options.llvm_args.iter(); let sess_args = cg_opts.chain(tg_opts); let user_specified_args: FxHashSet<_> = @@ -88,7 +88,7 @@ unsafe fn configure_llvm(sess: &Session) { .opts .debugging_opts .merge_functions - .unwrap_or(sess.target.target.options.merge_functions) + .unwrap_or(sess.target.options.merge_functions) { MergeFunctions::Disabled | MergeFunctions::Trampolines => {} MergeFunctions::Aliases => { @@ -96,9 +96,7 @@ unsafe fn configure_llvm(sess: &Session) { } } - if sess.target.target.target_os == "emscripten" - && sess.panic_strategy() == PanicStrategy::Unwind - { + if sess.target.target_os == "emscripten" && sess.panic_strategy() == PanicStrategy::Unwind { add("-enable-emscripten-cxx-exceptions", false); } @@ -140,7 +138,7 @@ pub fn time_trace_profiler_finish(file_name: &str) { // to LLVM or the feature detection code will walk past the end of the feature // array, leading to crashes. pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str { - let arch = if sess.target.target.arch == "x86_64" { "x86" } else { &*sess.target.target.arch }; + let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch }; match (arch, s) { ("x86", "pclmulqdq") => "pclmul", ("x86", "rdrand") => "rdrnd", @@ -217,7 +215,7 @@ fn handle_native(name: &str) -> &str { pub fn target_cpu(sess: &Session) -> &str { let name = match sess.opts.cg.target_cpu { Some(ref s) => &**s, - None => &*sess.target.target.options.cpu, + None => &*sess.target.options.cpu, }; handle_native(name) |
