@@ -749,29 +749,31 @@ pub(crate) unsafe fn codegen(
749
749
} ) ?;
750
750
}
751
751
752
- if config_emit_normal_obj && !config. no_integrated_as {
753
- let _timer = cgcx
754
- . prof
755
- . generic_activity_with_arg ( "LLVM_module_codegen_emit_obj" , & module. name [ ..] ) ;
756
- with_codegen ( tm, llmod, config. no_builtins , |cpm| {
757
- write_output_file (
758
- diag_handler,
759
- tm,
760
- cpm,
761
- llmod,
762
- & obj_out,
763
- llvm:: FileType :: ObjectFile ,
764
- )
765
- } ) ?;
766
- } else if config_emit_normal_obj && config. no_integrated_as {
767
- let _timer = cgcx
768
- . prof
769
- . generic_activity_with_arg ( "LLVM_module_codegen_asm_to_obj" , & module. name [ ..] ) ;
770
- let assembly = cgcx. output_filenames . temp_path ( OutputType :: Assembly , module_name) ;
771
- run_assembler ( cgcx, diag_handler, & assembly, & obj_out) ;
772
-
773
- if !config. emit_asm && !cgcx. save_temps {
774
- drop ( fs:: remove_file ( & assembly) ) ;
752
+ if config_emit_normal_obj {
753
+ if !config. no_integrated_as {
754
+ let _timer = cgcx
755
+ . prof
756
+ . generic_activity_with_arg ( "LLVM_module_codegen_emit_obj" , & module. name [ ..] ) ;
757
+ with_codegen ( tm, llmod, config. no_builtins , |cpm| {
758
+ write_output_file (
759
+ diag_handler,
760
+ tm,
761
+ cpm,
762
+ llmod,
763
+ & obj_out,
764
+ llvm:: FileType :: ObjectFile ,
765
+ )
766
+ } ) ?;
767
+ } else {
768
+ let _timer = cgcx
769
+ . prof
770
+ . generic_activity_with_arg ( "LLVM_module_codegen_asm_to_obj" , & module. name [ ..] ) ;
771
+ let assembly = cgcx. output_filenames . temp_path ( OutputType :: Assembly , module_name) ;
772
+ run_assembler ( cgcx, diag_handler, & assembly, & obj_out) ;
773
+
774
+ if !config. emit_asm && !cgcx. save_temps {
775
+ drop ( fs:: remove_file ( & assembly) ) ;
776
+ }
775
777
}
776
778
}
777
779
0 commit comments