Produce .dwo file for Packed as well

This commit is contained in:
Andy Wang 2021-12-06 18:10:16 +00:00
parent 4abed5000b
commit 32810223c6
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374

View file

@ -901,17 +901,14 @@ pub(crate) unsafe fn codegen(
.generic_activity_with_arg("LLVM_module_codegen_emit_obj", &module.name[..]); .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 = cgcx.output_filenames.temp_path_dwo(module_name);
let dwo_out = match cgcx.split_debuginfo { let dwo_out = if cgcx.target_can_use_split_dwarf
// Don't change how DWARF is emitted in single mode (or when disabled). && cgcx.split_debuginfo != SplitDebuginfo::Off
SplitDebuginfo::Off | SplitDebuginfo::Packed => None, {
// Emit (a subset of the) DWARF into a separate file in split mode. // Emit (a subset of the) DWARF into a separate file in split mode.
SplitDebuginfo::Unpacked => { Some(dwo_out.as_path())
if cgcx.target_can_use_split_dwarf { } else {
Some(dwo_out.as_path()) // Don't change how DWARF is emitted in single mode (or when disabled).
} else { None
None
}
}
}; };
with_codegen(tm, llmod, config.no_builtins, |cpm| { with_codegen(tm, llmod, config.no_builtins, |cpm| {
@ -948,7 +945,7 @@ pub(crate) unsafe fn codegen(
Ok(module.into_compiled_module( Ok(module.into_compiled_module(
config.emit_obj != EmitObj::None, 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, config.emit_bc,
&cgcx.output_filenames, &cgcx.output_filenames,
)) ))