Skip to content

Commit

Permalink
Produce .dwo file for Packed as well
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Dec 6, 2021
1 parent 4abed50 commit 3281022
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,17 +901,14 @@ pub(crate) unsafe fn codegen(
.generic_activity_with_arg("LLVM_module_codegen_emit_obj", &module.name[..]);

let dwo_out = cgcx.output_filenames.temp_path_dwo(module_name);
let dwo_out = match cgcx.split_debuginfo {
// Don't change how DWARF is emitted in single mode (or when disabled).
SplitDebuginfo::Off | SplitDebuginfo::Packed => None,
let dwo_out = if cgcx.target_can_use_split_dwarf
&& cgcx.split_debuginfo != SplitDebuginfo::Off
{
// Emit (a subset of the) DWARF into a separate file in split mode.
SplitDebuginfo::Unpacked => {
if cgcx.target_can_use_split_dwarf {
Some(dwo_out.as_path())
} else {
None
}
}
Some(dwo_out.as_path())
} else {
// Don't change how DWARF is emitted in single mode (or when disabled).
None
};

with_codegen(tm, llmod, config.no_builtins, |cpm| {
Expand Down Expand Up @@ -948,7 +945,7 @@ pub(crate) unsafe fn codegen(

Ok(module.into_compiled_module(
config.emit_obj != EmitObj::None,
cgcx.target_can_use_split_dwarf && cgcx.split_debuginfo == SplitDebuginfo::Unpacked,
cgcx.target_can_use_split_dwarf && cgcx.split_debuginfo != SplitDebuginfo::Off,
config.emit_bc,
&cgcx.output_filenames,
))
Expand Down

0 comments on commit 3281022

Please sign in to comment.