Remove cg_llvm/back/link.rs

This commit is contained in:
bjorn3 2019-03-30 15:30:07 +01:00
parent 93a3b414e3
commit dd4566f511
2 changed files with 12 additions and 29 deletions

View File

@ -1,25 +0,0 @@
use rustc::session::config::OutputFilenames;
use rustc::session::Session;
use rustc_codegen_ssa::CodegenResults;
use super::archive::LlvmArchiveBuilder;
use std::path::PathBuf;
pub use rustc_codegen_utils::link::*;
/// Performs the linkage portion of the compilation phase. This will generate all
/// of the requested outputs for this compilation session.
pub(crate) fn link_binary<'a>(
sess: &'a Session,
codegen_results: &CodegenResults,
outputs: &OutputFilenames,
crate_name: &str,
) -> Vec<PathBuf> {
let target_cpu = crate::llvm_util::target_cpu(sess);
rustc_codegen_ssa::back::link::link_binary::<LlvmArchiveBuilder<'a>>(
sess,
codegen_results,
outputs,
crate_name,
target_cpu,
)
}

View File

@ -71,9 +71,8 @@ use rustc_codegen_utils::codegen_backend::CodegenBackend;
mod error_codes;
mod back {
mod archive;
pub mod archive;
pub mod bytecode;
pub mod link;
pub mod lto;
pub mod write;
}
@ -327,8 +326,17 @@ impl CodegenBackend for LlvmCodegenBackend {
// This should produce either a finished executable or library.
sess.profiler(|p| p.start_activity("link_crate"));
time(sess, "linking", || {
back::link::link_binary(sess, &codegen_results,
outputs, &codegen_results.crate_name.as_str());
use rustc_codegen_ssa::back::link::link_binary;
use crate::back::archive::LlvmArchiveBuilder;
let target_cpu = crate::llvm_util::target_cpu(sess);
link_binary::<LlvmArchiveBuilder<'_>>(
sess,
&codegen_results,
outputs,
&codegen_results.crate_name.as_str(),
target_cpu,
);
});
sess.profiler(|p| p.end_activity("link_crate"));