@@ -56,11 +56,11 @@ pub(crate) unsafe fn codegen(
56
56
. generic_activity_with_arg ( "GCC_module_codegen_emit_bitcode" , & * module. name ) ;
57
57
context. add_command_line_option ( "-flto=auto" ) ;
58
58
context. add_command_line_option ( "-flto-partition=one" ) ;
59
+ context
60
+ . compile_to_file ( OutputKind :: ObjectFile , bc_out. to_str ( ) . expect ( "path to str" ) ) ;
59
61
if config. json_artifact_notifications {
60
62
dcx. emit_artifact_notification ( & bc_out, "llvm-bc" ) ;
61
63
}
62
- context
63
- . compile_to_file ( OutputKind :: ObjectFile , bc_out. to_str ( ) . expect ( "path to str" ) ) ;
64
64
}
65
65
66
66
if config. emit_obj == EmitObj :: ObjectCode ( BitcodeSection :: Full ) {
@@ -73,12 +73,12 @@ pub(crate) unsafe fn codegen(
73
73
context. add_command_line_option ( "-flto=auto" ) ;
74
74
context. add_command_line_option ( "-flto-partition=one" ) ;
75
75
context. add_command_line_option ( "-ffat-lto-objects" ) ;
76
- if config. json_artifact_notifications {
77
- dcx. emit_artifact_notification ( & bc_out, "llvm-bc" ) ;
78
- }
79
76
// TODO(antoyo): Send -plugin/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so to linker (this should be done when specifying the appropriate rustc cli argument).
80
77
context
81
78
. compile_to_file ( OutputKind :: ObjectFile , bc_out. to_str ( ) . expect ( "path to str" ) ) ;
79
+ if config. json_artifact_notifications {
80
+ dcx. emit_artifact_notification ( & bc_out, "llvm-bc" ) ;
81
+ }
82
82
}
83
83
}
84
84
@@ -125,9 +125,6 @@ pub(crate) unsafe fn codegen(
125
125
context. set_debug_info ( true ) ;
126
126
context. dump_to_file ( path, true ) ;
127
127
}
128
- if config. json_artifact_notifications {
129
- dcx. emit_artifact_notification ( & obj_out, "obj" ) ;
130
- }
131
128
if should_combine_object_files && fat_lto {
132
129
context. add_command_line_option ( "-flto=auto" ) ;
133
130
context. add_command_line_option ( "-flto-partition=one" ) ;
@@ -151,6 +148,9 @@ pub(crate) unsafe fn codegen(
151
148
obj_out. to_str ( ) . expect ( "path to str" ) ,
152
149
) ;
153
150
}
151
+ if config. json_artifact_notifications {
152
+ dcx. emit_artifact_notification ( & obj_out, "obj" ) ;
153
+ }
154
154
}
155
155
156
156
EmitObj :: Bitcode => {
0 commit comments