Skip to content

Commit c732a8f

Browse files
committed
emit artifct notification after generating a file
1 parent 9f611ea commit c732a8f

File tree

1 file changed

+8
-8
lines changed
  • compiler/rustc_codegen_gcc/src/back

1 file changed

+8
-8
lines changed

compiler/rustc_codegen_gcc/src/back/write.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ pub(crate) unsafe fn codegen(
5656
.generic_activity_with_arg("GCC_module_codegen_emit_bitcode", &*module.name);
5757
context.add_command_line_option("-flto=auto");
5858
context.add_command_line_option("-flto-partition=one");
59+
context
60+
.compile_to_file(OutputKind::ObjectFile, bc_out.to_str().expect("path to str"));
5961
if config.json_artifact_notifications {
6062
dcx.emit_artifact_notification(&bc_out, "llvm-bc");
6163
}
62-
context
63-
.compile_to_file(OutputKind::ObjectFile, bc_out.to_str().expect("path to str"));
6464
}
6565

6666
if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Full) {
@@ -73,12 +73,12 @@ pub(crate) unsafe fn codegen(
7373
context.add_command_line_option("-flto=auto");
7474
context.add_command_line_option("-flto-partition=one");
7575
context.add_command_line_option("-ffat-lto-objects");
76-
if config.json_artifact_notifications {
77-
dcx.emit_artifact_notification(&bc_out, "llvm-bc");
78-
}
7976
// 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).
8077
context
8178
.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+
}
8282
}
8383
}
8484

@@ -125,9 +125,6 @@ pub(crate) unsafe fn codegen(
125125
context.set_debug_info(true);
126126
context.dump_to_file(path, true);
127127
}
128-
if config.json_artifact_notifications {
129-
dcx.emit_artifact_notification(&obj_out, "obj");
130-
}
131128
if should_combine_object_files && fat_lto {
132129
context.add_command_line_option("-flto=auto");
133130
context.add_command_line_option("-flto-partition=one");
@@ -151,6 +148,9 @@ pub(crate) unsafe fn codegen(
151148
obj_out.to_str().expect("path to str"),
152149
);
153150
}
151+
if config.json_artifact_notifications {
152+
dcx.emit_artifact_notification(&obj_out, "obj");
153+
}
154154
}
155155

156156
EmitObj::Bitcode => {

0 commit comments

Comments
 (0)