Skip to content

Commit a147cd0

Browse files
committed
Introduce a local variable config_emit_normal_obj.
This adds a missing `!config.obj_is_bitcode` condition to two places that should have it. As a result, when `obj_is_bitcode` and `no_integrated_as` are both true, the compiler will no longer unnecessarily emit asm, convert it to an object file, and then overwrite that object file with bitcode.
1 parent f8261b4 commit a147cd0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc_codegen_llvm/back/write.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,9 @@ pub(crate) unsafe fn codegen(
732732
})?;
733733
}
734734

735-
if config.emit_asm || (config.emit_obj && config.no_integrated_as) {
735+
let config_emit_normal_obj = config.emit_obj && !config.obj_is_bitcode;
736+
737+
if config.emit_asm || (config_emit_normal_obj && config.no_integrated_as) {
736738
let _timer = cgcx
737739
.prof
738740
.generic_activity_with_arg("LLVM_module_codegen_emit_asm", &module.name[..]);
@@ -747,7 +749,7 @@ pub(crate) unsafe fn codegen(
747749
})?;
748750
}
749751

750-
if config.emit_obj && !config.obj_is_bitcode && !config.no_integrated_as {
752+
if config_emit_normal_obj && !config.no_integrated_as {
751753
let _timer = cgcx
752754
.prof
753755
.generic_activity_with_arg("LLVM_module_codegen_emit_obj", &module.name[..]);
@@ -761,7 +763,7 @@ pub(crate) unsafe fn codegen(
761763
llvm::FileType::ObjectFile,
762764
)
763765
})?;
764-
} else if config.emit_obj && config.no_integrated_as {
766+
} else if config_emit_normal_obj && config.no_integrated_as {
765767
let _timer = cgcx
766768
.prof
767769
.generic_activity_with_arg("LLVM_module_codegen_asm_to_obj", &module.name[..]);

0 commit comments

Comments
 (0)