diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2019-02-01 15:15:43 +0100 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2019-02-12 15:10:29 +0100 |
| commit | 04f425d2c31ea0ef022793a3fdcb8af84d471b86 (patch) | |
| tree | a57c5d535bf6cdbed732223013da3f9907ea6b78 /src/librustc_codegen_llvm | |
| parent | a54b5c7a645ead203d77e78245362f9e0f00dd3c (diff) | |
| download | rust-04f425d2c31ea0ef022793a3fdcb8af84d471b86.tar.gz rust-04f425d2c31ea0ef022793a3fdcb8af84d471b86.zip | |
Stabilize linker-plugin based LTO.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/back/link.rs | 4 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/back/lto.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/consts.rs | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs index fc744201a33..8bb985ecc25 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -857,7 +857,7 @@ fn link_args(cmd: &mut dyn Linker, codegen_results: &CodegenResults) { // Linker plugins should be specified early in the list of arguments - cmd.cross_lang_lto(); + cmd.linker_plugin_lto(); // The default library location, we need this to find the runtime. // The location of crates will be determined as needed. @@ -1491,7 +1491,7 @@ fn are_upstream_rust_objects_already_included(sess: &Session) -> bool { Lto::Thin => { // If we defer LTO to the linker, we haven't run LTO ourselves, so // any upstream object files have not been copied yet. - !sess.opts.debugging_opts.cross_lang_lto.enabled() + !sess.opts.cg.linker_plugin_lto.enabled() } Lto::No | Lto::ThinLocal => false, diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs index 3e51078dc64..b6b880c7ec4 100644 --- a/src/librustc_codegen_llvm/back/lto.rs +++ b/src/librustc_codegen_llvm/back/lto.rs @@ -159,7 +159,7 @@ pub(crate) fn run_thin(cgcx: &CodegenContext<LlvmCodegenBackend>, let symbol_white_list = symbol_white_list.iter() .map(|c| c.as_ptr()) .collect::<Vec<_>>(); - if cgcx.opts.debugging_opts.cross_lang_lto.enabled() { + if cgcx.opts.cg.linker_plugin_lto.enabled() { unreachable!("We should never reach this case if the LTO step \ is deferred to the linker"); } diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 47637f3c5d7..e7871531972 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -366,7 +366,7 @@ pub(crate) unsafe fn optimize(cgcx: &CodegenContext<LlvmCodegenBackend>, let opt_level = config.opt_level.map(|x| to_llvm_opt_settings(x).0) .unwrap_or(llvm::CodeGenOptLevel::None); let prepare_for_thin_lto = cgcx.lto == Lto::Thin || cgcx.lto == Lto::ThinLocal || - (cgcx.lto != Lto::Fat && cgcx.opts.debugging_opts.cross_lang_lto.enabled()); + (cgcx.lto != Lto::Fat && cgcx.opts.cg.linker_plugin_lto.enabled()); with_llvm_pmb(llmod, &config, opt_level, prepare_for_thin_lto, &mut |b| { llvm::LLVMPassManagerBuilderPopulateFunctionPassManager(b, fpm); llvm::LLVMPassManagerBuilderPopulateModulePassManager(b, mpm); diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs index b7a9382c338..ca9e2c87be2 100644 --- a/src/librustc_codegen_llvm/consts.rs +++ b/src/librustc_codegen_llvm/consts.rs @@ -275,12 +275,12 @@ impl CodegenCx<'ll, 'tcx> { self.use_dll_storage_attrs && !self.tcx.is_foreign_item(def_id) && // ThinLTO can't handle this workaround in all cases, so we don't // emit the attrs. Instead we make them unnecessary by disallowing - // dynamic linking when cross-language LTO is enabled. - !self.tcx.sess.opts.debugging_opts.cross_lang_lto.enabled(); + // dynamic linking when linker plugin based LTO is enabled. + !self.tcx.sess.opts.cg.linker_plugin_lto.enabled(); // If this assertion triggers, there's something wrong with commandline // argument validation. - debug_assert!(!(self.tcx.sess.opts.debugging_opts.cross_lang_lto.enabled() && + debug_assert!(!(self.tcx.sess.opts.cg.linker_plugin_lto.enabled() && self.tcx.sess.target.target.options.is_like_msvc && self.tcx.sess.opts.cg.prefer_dynamic)); |
