@@ -21,7 +21,6 @@ pub struct LlvmArchiveBuilder<'a> {
21
21
sess : & ' a Session ,
22
22
dst : PathBuf ,
23
23
src : Option < PathBuf > ,
24
- removals : Vec < String > ,
25
24
additions : Vec < Addition > ,
26
25
src_archive : Option < Option < ArchiveRO > > ,
27
26
}
@@ -65,35 +64,11 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
65
64
sess,
66
65
dst : output. to_path_buf ( ) ,
67
66
src : input. map ( |p| p. to_path_buf ( ) ) ,
68
- removals : Vec :: new ( ) ,
69
67
additions : Vec :: new ( ) ,
70
68
src_archive : None ,
71
69
}
72
70
}
73
71
74
- /// Removes a file from this archive
75
- fn remove_file ( & mut self , file : & str ) {
76
- self . removals . push ( file. to_string ( ) ) ;
77
- }
78
-
79
- /// Lists all files in an archive
80
- fn src_files ( & mut self ) -> Vec < String > {
81
- if self . src_archive ( ) . is_none ( ) {
82
- return Vec :: new ( ) ;
83
- }
84
-
85
- let archive = self . src_archive . as_ref ( ) . unwrap ( ) . as_ref ( ) . unwrap ( ) ;
86
-
87
- archive
88
- . iter ( )
89
- . filter_map ( |child| child. ok ( ) )
90
- . filter ( is_relevant_child)
91
- . filter_map ( |child| child. name ( ) )
92
- . filter ( |name| !self . removals . iter ( ) . any ( |x| x == name) )
93
- . map ( |name| name. to_owned ( ) )
94
- . collect ( )
95
- }
96
-
97
72
fn add_archive < F > ( & mut self , archive : & Path , skip : F ) -> io:: Result < ( ) >
98
73
where
99
74
F : FnMut ( & str ) -> bool + ' static ,
@@ -296,7 +271,6 @@ impl<'a> LlvmArchiveBuilder<'a> {
296
271
}
297
272
298
273
fn build_with_llvm ( & mut self , kind : ArchiveKind ) -> io:: Result < ( ) > {
299
- let removals = mem:: take ( & mut self . removals ) ;
300
274
let mut additions = mem:: take ( & mut self . additions ) ;
301
275
let mut strings = Vec :: new ( ) ;
302
276
let mut members = Vec :: new ( ) ;
@@ -308,9 +282,6 @@ impl<'a> LlvmArchiveBuilder<'a> {
308
282
for child in archive. iter ( ) {
309
283
let child = child. map_err ( string_to_io_error) ?;
310
284
let Some ( child_name) = child. name ( ) else { continue } ;
311
- if removals. iter ( ) . any ( |r| r == child_name) {
312
- continue ;
313
- }
314
285
315
286
let name = CString :: new ( child_name) ?;
316
287
members. push ( llvm:: LLVMRustArchiveMemberNew (
0 commit comments