diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-25 20:08:40 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-30 10:32:32 +0000 |
| commit | 3c987cbe0284a954f025546e53b7007ae1cc95f1 (patch) | |
| tree | 7ab9b43197c1f5976199c41d720c0362fa46a899 /compiler/rustc_codegen_llvm/src | |
| parent | bb764bd406fbfbbd24ac162a1c9d10d349b5e386 (diff) | |
| download | rust-3c987cbe0284a954f025546e53b7007ae1cc95f1.tar.gz rust-3c987cbe0284a954f025546e53b7007ae1cc95f1.zip | |
Move computation of decorated names out of the create_dll_import_lib method
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/archive.rs | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs index 8ef9f8b855d..d6faa26507f 100644 --- a/compiler/rustc_codegen_llvm/src/back/archive.rs +++ b/compiler/rustc_codegen_llvm/src/back/archive.rs @@ -9,7 +9,6 @@ use rustc_codegen_ssa::back::archive::{ ArchiveBuilderBuilder, ObjectReader, UnknownArchiveKind, DEFAULT_OBJECT_READER, }; use rustc_codegen_ssa::common; -use rustc_session::cstore::DllImport; use rustc_session::Session; use tracing::trace; @@ -119,26 +118,12 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { &self, sess: &Session, lib_name: &str, - dll_imports: &[DllImport], + import_name_and_ordinal_vector: Vec<(String, Option<u16>)>, output_path: &Path, ) { let target = &sess.target; let mingw_gnu_toolchain = common::is_mingw_gnu_toolchain(target); - let import_name_and_ordinal_vector: Vec<(String, Option<u16>)> = dll_imports - .iter() - .map(|import: &DllImport| { - if sess.target.arch == "x86" { - ( - common::i686_decorated_name(import, mingw_gnu_toolchain, false), - import.ordinal(), - ) - } else { - (import.name.to_string(), import.ordinal()) - } - }) - .collect(); - if mingw_gnu_toolchain { // The binutils linker used on -windows-gnu targets cannot read the import // libraries generated by LLVM: in our attempts, the linker produced an .EXE @@ -236,9 +221,9 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { trace!(" output_path {}", output_path.display()); trace!( " import names: {}", - dll_imports + import_name_and_ordinal_vector .iter() - .map(|import| import.name.to_string()) + .map(|(name, _ordinal)| name.clone()) .collect::<Vec<_>>() .join(", "), ); |
