Auto merge of #86911 - bjorn3:crate_info_refactor, r=petrochenkov

Refactor linker code

This merges `LinkerInfo` into `CrateInfo` as there is no reason to keep them separate. `LinkerInfo::to_linker` is merged into `get_linker` as both have different logic for each linker type and `to_linker` is directly called after `get_linker`. Also contains a couple of small cleanups.

See the individual commits for all changes.
This commit is contained in:
bors 2021-07-06 22:20:43 +00:00
commit b20e3ff2af
10 changed files with 169 additions and 204 deletions

View file

@ -292,12 +292,7 @@ impl CodegenBackend for LlvmCodegenBackend {
// Run the linker on any artifacts that resulted from the LLVM run.
// This should produce either a finished executable or library.
link_binary::<LlvmArchiveBuilder<'_>>(
sess,
&codegen_results,
outputs,
&codegen_results.crate_info.local_crate_name.as_str(),
);
link_binary::<LlvmArchiveBuilder<'_>>(sess, &codegen_results, outputs);
Ok(())
}