@@ -106,8 +106,7 @@ pub fn write_output_file(
106106 file_type : llvm:: FileType ) -> Result < ( ) , FatalError > {
107107 unsafe {
108108 let output_c = path2cstr ( output) ;
109- let result = llvm:: LLVMRustWriteOutputFile (
110- target, pm, m, output_c. as_ptr ( ) , file_type) ;
109+ let result = llvm:: LLVMRustWriteOutputFile ( target, pm, m, output_c. as_ptr ( ) , file_type) ;
111110 if result. into_result ( ) . is_err ( ) {
112111 let msg = format ! ( "could not write output to {}" , output. display( ) ) ;
113112 Err ( llvm_err ( handler, msg) )
@@ -590,8 +589,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
590589
591590 for pass in & config. passes {
592591 if !addpass ( pass) {
593- diag_handler. warn ( & format ! ( "unknown pass `{}`, ignoring" ,
594- pass) ) ;
592+ diag_handler. warn ( & format ! ( "unknown pass `{}`, ignoring" , pass) ) ;
595593 }
596594 if pass == "name-anon-globals" {
597595 have_name_anon_globals_pass = true ;
@@ -601,8 +599,8 @@ unsafe fn optimize(cgcx: &CodegenContext,
601599 for pass in & cgcx. plugin_passes {
602600 if !addpass ( pass) {
603601 diag_handler. err ( & format ! ( "a plugin asked for LLVM pass \
604- `{}` but LLVM does not \
605- recognize it", pass) ) ;
602+ `{}` but LLVM does not \
603+ recognize it", pass) ) ;
606604 }
607605 if pass == "name-anon-globals" {
608606 have_name_anon_globals_pass = true ;
@@ -613,12 +611,12 @@ unsafe fn optimize(cgcx: &CodegenContext,
613611 // As described above, this will probably cause an error in LLVM
614612 if config. no_prepopulate_passes {
615613 diag_handler. err ( "The current compilation is going to use thin LTO buffers \
616- without running LLVM's NameAnonGlobals pass. \
617- This will likely cause errors in LLVM. Consider adding \
618- -C passes=name-anon-globals to the compiler command line.") ;
614+ without running LLVM's NameAnonGlobals pass. \
615+ This will likely cause errors in LLVM. Consider adding \
616+ -C passes=name-anon-globals to the compiler command line.") ;
619617 } else {
620618 bug ! ( "We are using thin LTO buffers without running the NameAnonGlobals pass. \
621- This will likely cause errors in LLVM and should never happen.") ;
619+ This will likely cause errors in LLVM and should never happen.") ;
622620 }
623621 }
624622 }
@@ -704,9 +702,9 @@ unsafe fn codegen(cgcx: &CodegenContext,
704702 // escape the closure itself, and the manager should only be
705703 // used once.
706704 unsafe fn with_codegen < ' ll , F , R > ( tm : & ' ll llvm:: TargetMachine ,
707- llmod : & ' ll llvm:: Module ,
708- no_builtins : bool ,
709- f : F ) -> R
705+ llmod : & ' ll llvm:: Module ,
706+ no_builtins : bool ,
707+ f : F ) -> R
710708 where F : FnOnce ( & ' ll mut PassManager < ' ll > ) -> R ,
711709 {
712710 let cpm = llvm:: LLVMCreatePassManager ( ) ;
@@ -818,15 +816,15 @@ unsafe fn codegen(cgcx: &CodegenContext,
818816 } ;
819817 with_codegen ( tm, llmod, config. no_builtins , |cpm| {
820818 write_output_file ( diag_handler, tm, cpm, llmod, & path,
821- llvm:: FileType :: AssemblyFile )
819+ llvm:: FileType :: AssemblyFile )
822820 } ) ?;
823821 timeline. record ( "asm" ) ;
824822 }
825823
826824 if write_obj {
827825 with_codegen ( tm, llmod, config. no_builtins , |cpm| {
828826 write_output_file ( diag_handler, tm, cpm, llmod, & obj_out,
829- llvm:: FileType :: ObjectFile )
827+ llvm:: FileType :: ObjectFile )
830828 } ) ?;
831829 timeline. record ( "obj" ) ;
832830 } else if asm_to_obj {
@@ -947,11 +945,11 @@ fn need_pre_thin_lto_bitcode_for_incr_comp(sess: &Session) -> bool {
947945}
948946
949947pub fn start_async_codegen ( tcx : TyCtxt ,
950- time_graph : Option < TimeGraph > ,
951- metadata : EncodedMetadata ,
952- coordinator_receive : Receiver < Box < dyn Any + Send > > ,
953- total_cgus : usize )
954- -> OngoingCodegen {
948+ time_graph : Option < TimeGraph > ,
949+ metadata : EncodedMetadata ,
950+ coordinator_receive : Receiver < Box < dyn Any + Send > > ,
951+ total_cgus : usize )
952+ -> OngoingCodegen {
955953 let sess = tcx. sess ;
956954 let crate_name = tcx. crate_name ( LOCAL_CRATE ) ;
957955 let crate_hash = tcx. crate_hash ( LOCAL_CRATE ) ;
@@ -1116,7 +1114,8 @@ fn copy_all_cgu_workproducts_to_incr_comp_cache_dir(
11161114 }
11171115
11181116 if let Some ( ( id, product) ) =
1119- copy_cgu_workproducts_to_incr_comp_cache_dir ( sess, & module. name , & files) {
1117+ copy_cgu_workproducts_to_incr_comp_cache_dir ( sess, & module. name , & files)
1118+ {
11201119 work_products. insert ( id, product) ;
11211120 }
11221121 }
@@ -1584,10 +1583,8 @@ fn start_executing_work(tcx: TyCtxt,
15841583
15851584 let ( name, mut cmd) = get_linker ( sess, & linker, flavor) ;
15861585 cmd. args ( & sess. target . target . options . asm_args ) ;
1587- Some ( Arc :: new ( AssemblerCommand {
1588- name,
1589- cmd,
1590- } ) )
1586+
1587+ Some ( Arc :: new ( AssemblerCommand { name, cmd } ) )
15911588 } else {
15921589 None
15931590 } ;
@@ -2186,9 +2183,9 @@ pub fn run_assembler(cgcx: &CodegenContext, handler: &Handler, assembly: &Path,
21862183 handler. struct_err ( & format ! ( "linking with `{}` failed: {}" ,
21872184 pname. display( ) ,
21882185 prog. status) )
2189- . note ( & format ! ( "{:?}" , & cmd) )
2190- . note ( str:: from_utf8 ( & note[ ..] ) . unwrap ( ) )
2191- . emit ( ) ;
2186+ . note ( & format ! ( "{:?}" , & cmd) )
2187+ . note ( str:: from_utf8 ( & note[ ..] ) . unwrap ( ) )
2188+ . emit ( ) ;
21922189 handler. abort_if_errors ( ) ;
21932190 }
21942191 } ,
@@ -2450,8 +2447,8 @@ impl OngoingCodegen {
24502447 }
24512448
24522449 pub ( crate ) fn submit_pre_codegened_module_to_llvm ( & self ,
2453- tcx : TyCtxt ,
2454- module : ModuleCodegen ) {
2450+ tcx : TyCtxt ,
2451+ module : ModuleCodegen ) {
24552452 self . wait_for_signal_to_codegen_item ( ) ;
24562453 self . check_for_errors ( tcx. sess ) ;
24572454
0 commit comments