diff options
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index d3c71ff501b..150cedde7e8 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -118,18 +118,18 @@ pub unsafe fn create_module( let mod_name = SmallCStr::new(mod_name); let llmod = llvm::LLVMModuleCreateWithNameInContext(mod_name.as_ptr(), llcx); - let mut target_data_layout = sess.target.target.data_layout.clone(); + let mut target_data_layout = sess.target.data_layout.clone(); if llvm_util::get_major_version() < 9 { target_data_layout = strip_function_ptr_alignment(target_data_layout); } if llvm_util::get_major_version() < 10 { - if sess.target.target.arch == "x86" || sess.target.target.arch == "x86_64" { + if sess.target.arch == "x86" || sess.target.arch == "x86_64" { target_data_layout = strip_x86_address_spaces(target_data_layout); } } // Ensure the data-layout values hardcoded remain the defaults. - if sess.target.target.options.is_builtin { + if sess.target.options.is_builtin { let tm = crate::back::write::create_informational_target_machine(tcx.sess); llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm); llvm::LLVMRustDisposeTargetMachine(tm); @@ -160,7 +160,7 @@ pub unsafe fn create_module( bug!( "data-layout for builtin `{}` target, `{}`, \ differs from LLVM default, `{}`", - sess.target.target.llvm_target, + sess.target.llvm_target, target_data_layout, llvm_data_layout ); @@ -170,7 +170,7 @@ pub unsafe fn create_module( let data_layout = SmallCStr::new(&target_data_layout); llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr()); - let llvm_target = SmallCStr::new(&sess.target.target.llvm_target); + let llvm_target = SmallCStr::new(&sess.target.llvm_target); llvm::LLVMRustSetNormalizedTarget(llmod, llvm_target.as_ptr()); if sess.relocation_model() == RelocModel::Pic { @@ -190,7 +190,7 @@ pub unsafe fn create_module( } // Control Flow Guard is currently only supported by the MSVC linker on Windows. - if sess.target.target.options.is_like_msvc { + if sess.target.options.is_like_msvc { match sess.opts.cg.control_flow_guard { CFGuard::Disabled => {} CFGuard::NoChecks => { @@ -265,7 +265,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { // linker will take care of everything. Fixing this problem will likely // require adding a few attributes to Rust itself (feature gated at the // start) and then strongly recommending static linkage on Windows! - let use_dll_storage_attrs = tcx.sess.target.target.options.is_like_windows; + let use_dll_storage_attrs = tcx.sess.target.options.is_like_windows; let check_overflow = tcx.sess.overflow_checks(); @@ -839,7 +839,7 @@ impl CodegenCx<'b, 'tcx> { return eh_catch_typeinfo; } let tcx = self.tcx; - assert!(self.sess().target.target.options.is_like_emscripten); + assert!(self.sess().target.options.is_like_emscripten); let eh_catch_typeinfo = match tcx.lang_items().eh_catch_typeinfo() { Some(def_id) => self.get_static(def_id), _ => { @@ -878,7 +878,7 @@ impl HasDataLayout for CodegenCx<'ll, 'tcx> { impl HasTargetSpec for CodegenCx<'ll, 'tcx> { fn target_spec(&self) -> &Target { - &self.tcx.sess.target.target + &self.tcx.sess.target } } |
