@@ -20,7 +20,6 @@ use rustc_codegen_ssa::back::archive::{
2020use rustc_codegen_ssa:: common;
2121use tracing:: trace;
2222
23- use rustc_session:: cstore:: DllImport ;
2423use rustc_session:: Session ;
2524
2625/// Helper for adding many files to an archive.
@@ -123,26 +122,12 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
123122 & self ,
124123 sess : & Session ,
125124 lib_name : & str ,
126- dll_imports : & [ DllImport ] ,
125+ import_name_and_ordinal_vector : Vec < ( String , Option < u16 > ) > ,
127126 output_path : & Path ,
128127 ) {
129128 let target = & sess. target ;
130129 let mingw_gnu_toolchain = common:: is_mingw_gnu_toolchain ( target) ;
131130
132- let import_name_and_ordinal_vector: Vec < ( String , Option < u16 > ) > = dll_imports
133- . iter ( )
134- . map ( |import : & DllImport | {
135- if sess. target . arch == "x86" {
136- (
137- common:: i686_decorated_name ( import, mingw_gnu_toolchain, false ) ,
138- import. ordinal ( ) ,
139- )
140- } else {
141- ( import. name . to_string ( ) , import. ordinal ( ) )
142- }
143- } )
144- . collect ( ) ;
145-
146131 if mingw_gnu_toolchain {
147132 // The binutils linker used on -windows-gnu targets cannot read the import
148133 // libraries generated by LLVM: in our attempts, the linker produced an .EXE
@@ -240,9 +225,9 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
240225 trace ! ( " output_path {}" , output_path. display( ) ) ;
241226 trace ! (
242227 " import names: {}" ,
243- dll_imports
228+ import_name_and_ordinal_vector
244229 . iter( )
245- . map( |import| import . name. to_string ( ) )
230+ . map( |( name , _ordinal ) | name. clone ( ) )
246231 . collect:: <Vec <_>>( )
247232 . join( ", " ) ,
248233 ) ;
0 commit comments