diff options
| author | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-07-31 04:17:04 +0000 |
|---|---|---|
| committer | The rustc-josh-sync Cronjob Bot <github-actions@github.com> | 2025-07-31 04:17:04 +0000 |
| commit | 7cab27d73ab228be6a1eface8f0cb2f3c3b76c7c (patch) | |
| tree | 876a5497b9c06e8e288e63278e19ce1397fd015f /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | 7d378192a7d0c7829b7ee32e292d24bd89d7ca3d (diff) | |
| parent | 32e7a4b92b109c24e9822c862a7c74436b50e564 (diff) | |
| download | rust-7cab27d73ab228be6a1eface8f0cb2f3c3b76c7c.tar.gz rust-7cab27d73ab228be6a1eface8f0cb2f3c3b76c7c.zip | |
Merge ref '32e7a4b92b10' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 32e7a4b92b109c24e9822c862a7c74436b50e564 Filtered ref: d39f3479bfafb04026ed3afec68aa671d13e9c3c This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 6f8fba2a30d..85a06f457eb 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -796,29 +796,6 @@ pub(crate) fn optimize( Ok(()) } -pub(crate) fn link( - cgcx: &CodegenContext<LlvmCodegenBackend>, - dcx: DiagCtxtHandle<'_>, - mut modules: Vec<ModuleCodegen<ModuleLlvm>>, -) -> Result<ModuleCodegen<ModuleLlvm>, FatalError> { - use super::lto::{Linker, ModuleBuffer}; - // Sort the modules by name to ensure deterministic behavior. - modules.sort_by(|a, b| a.name.cmp(&b.name)); - let (first, elements) = - modules.split_first().expect("Bug! modules must contain at least one module."); - - let mut linker = Linker::new(first.module_llvm.llmod()); - for module in elements { - let _timer = cgcx.prof.generic_activity_with_arg("LLVM_link_module", &*module.name); - let buffer = ModuleBuffer::new(module.module_llvm.llmod()); - linker - .add(buffer.data()) - .map_err(|()| llvm_err(dcx, LlvmError::SerializeModule { name: &module.name }))?; - } - drop(linker); - Ok(modules.remove(0)) -} - pub(crate) fn codegen( cgcx: &CodegenContext<LlvmCodegenBackend>, module: ModuleCodegen<ModuleLlvm>, |
