@@ -109,7 +109,7 @@ fn prepare_lto(
109
109
. extend ( exported_symbols[ & cnum] . iter ( ) . filter_map ( symbol_filter) ) ;
110
110
}
111
111
112
- let archive = ArchiveRO :: open ( & path) . expect ( "wanted an rlib" ) ;
112
+ let archive = ArchiveRO :: open ( path) . expect ( "wanted an rlib" ) ;
113
113
let obj_files = archive
114
114
. iter ( )
115
115
. filter_map ( |child| child. ok ( ) . and_then ( |c| c. name ( ) . map ( |name| ( name, c) ) ) )
@@ -316,14 +316,14 @@ fn fat_lto(
316
316
. generic_activity_with_arg ( "LLVM_fat_lto_link_module" , format ! ( "{:?}" , name) ) ;
317
317
info ! ( "linking {:?}" , name) ;
318
318
let data = bc_decoded. data ( ) ;
319
- linker. add ( & data) . map_err ( |( ) | {
319
+ linker. add ( data) . map_err ( |( ) | {
320
320
let msg = format ! ( "failed to load bc of {:?}" , name) ;
321
- write:: llvm_err ( & diag_handler, & msg)
321
+ write:: llvm_err ( diag_handler, & msg)
322
322
} ) ?;
323
323
serialized_bitcode. push ( bc_decoded) ;
324
324
}
325
325
drop ( linker) ;
326
- save_temp_bitcode ( & cgcx, & module, "lto.input" ) ;
326
+ save_temp_bitcode ( cgcx, & module, "lto.input" ) ;
327
327
328
328
// Fat LTO also suffers from the invalid DWARF issue similar to Thin LTO.
329
329
// Here we rewrite all `DICompileUnit` pointers if there is only one `DICompileUnit`.
@@ -347,14 +347,14 @@ fn fat_lto(
347
347
ptr as * const * const libc:: c_char ,
348
348
symbols_below_threshold. len ( ) as libc:: size_t ,
349
349
) ;
350
- save_temp_bitcode ( & cgcx, & module, "lto.after-restriction" ) ;
350
+ save_temp_bitcode ( cgcx, & module, "lto.after-restriction" ) ;
351
351
}
352
352
353
353
if cgcx. no_landing_pads {
354
354
unsafe {
355
355
llvm:: LLVMRustMarkAllFunctionsNounwind ( llmod) ;
356
356
}
357
- save_temp_bitcode ( & cgcx, & module, "lto.after-nounwind" ) ;
357
+ save_temp_bitcode ( cgcx, & module, "lto.after-nounwind" ) ;
358
358
}
359
359
}
360
360
@@ -498,7 +498,7 @@ fn thin_lto(
498
498
symbols_below_threshold. as_ptr ( ) ,
499
499
symbols_below_threshold. len ( ) as u32 ,
500
500
)
501
- . ok_or_else ( || write:: llvm_err ( & diag_handler, "failed to prepare thin LTO context" ) ) ?;
501
+ . ok_or_else ( || write:: llvm_err ( diag_handler, "failed to prepare thin LTO context" ) ) ?;
502
502
503
503
let data = ThinData ( data) ;
504
504
@@ -572,7 +572,7 @@ fn thin_lto(
572
572
if let Some ( path) = key_map_path {
573
573
if let Err ( err) = curr_key_map. save_to_file ( & path) {
574
574
let msg = format ! ( "Error while writing ThinLTO key data: {}" , err) ;
575
- return Err ( write:: llvm_err ( & diag_handler, & msg) ) ;
575
+ return Err ( write:: llvm_err ( diag_handler, & msg) ) ;
576
576
}
577
577
}
578
578
@@ -744,8 +744,7 @@ pub unsafe fn optimize_thin_module(
744
744
// crates but for locally codegened modules we may be able to reuse
745
745
// that LLVM Context and Module.
746
746
let llcx = llvm:: LLVMRustContextCreate ( cgcx. fewer_names ) ;
747
- let llmod_raw =
748
- parse_module ( llcx, & module_name, thin_module. data ( ) , & diag_handler) ? as * const _ ;
747
+ let llmod_raw = parse_module ( llcx, module_name, thin_module. data ( ) , & diag_handler) ? as * const _ ;
749
748
let module = ModuleCodegen {
750
749
module_llvm : ModuleLlvm { llmod_raw, llcx, tm } ,
751
750
name : thin_module. name ( ) . to_string ( ) ,
@@ -754,7 +753,7 @@ pub unsafe fn optimize_thin_module(
754
753
{
755
754
let target = & * module. module_llvm . tm ;
756
755
let llmod = module. module_llvm . llmod ( ) ;
757
- save_temp_bitcode ( & cgcx, & module, "thin-lto-input" ) ;
756
+ save_temp_bitcode ( cgcx, & module, "thin-lto-input" ) ;
758
757
759
758
// Before we do much else find the "main" `DICompileUnit` that we'll be
760
759
// using below. If we find more than one though then rustc has changed
@@ -775,7 +774,7 @@ pub unsafe fn optimize_thin_module(
775
774
. prof
776
775
. generic_activity_with_arg ( "LLVM_thin_lto_remove_landing_pads" , thin_module. name ( ) ) ;
777
776
llvm:: LLVMRustMarkAllFunctionsNounwind ( llmod) ;
778
- save_temp_bitcode ( & cgcx, & module, "thin-lto-after-nounwind" ) ;
777
+ save_temp_bitcode ( cgcx, & module, "thin-lto-after-nounwind" ) ;
779
778
}
780
779
781
780
// Up next comes the per-module local analyses that we do for Thin LTO.
@@ -947,7 +946,7 @@ pub fn parse_module<'a>(
947
946
llvm:: LLVMRustParseBitcodeForLTO ( cx, data. as_ptr ( ) , data. len ( ) , name. as_ptr ( ) ) . ok_or_else (
948
947
|| {
949
948
let msg = "failed to parse bitcode for LTO module" ;
950
- write:: llvm_err ( & diag_handler, msg)
949
+ write:: llvm_err ( diag_handler, msg)
951
950
} ,
952
951
)
953
952
}
0 commit comments