File tree 1 file changed +8
-2
lines changed
compiler/rustc_codegen_llvm/src/debuginfo
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ use rustc_span::FileName;
39
39
use rustc_span:: { FileNameDisplayPreference , SourceFile } ;
40
40
use rustc_symbol_mangling:: typeid_for_trait_ref;
41
41
use rustc_target:: abi:: { Align , Size } ;
42
+ use rustc_target:: spec:: DebuginfoKind ;
42
43
use smallvec:: smallvec;
43
44
44
45
use libc:: { c_char, c_longlong, c_uint} ;
@@ -881,9 +882,14 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>(
881
882
882
883
let dwarf_version =
883
884
tcx. sess . opts . unstable_opts . dwarf_version . unwrap_or ( tcx. sess . target . default_dwarf_version ) ;
885
+ let is_dwarf_kind =
886
+ matches ! ( tcx. sess. target. debuginfo_kind, DebuginfoKind :: Dwarf | DebuginfoKind :: DwarfDsym ) ;
884
887
// Don't emit `.debug_pubnames` and `.debug_pubtypes` on DWARFv4 or lower.
885
- let debug_name_table_kind =
886
- if dwarf_version > 4 { DebugNameTableKind :: Default } else { DebugNameTableKind :: None } ;
888
+ let debug_name_table_kind = if is_dwarf_kind && dwarf_version <= 4 {
889
+ DebugNameTableKind :: None
890
+ } else {
891
+ DebugNameTableKind :: Default
892
+ } ;
887
893
888
894
unsafe {
889
895
let compile_unit_file = llvm:: LLVMRustDIBuilderCreateFile (
You can’t perform that action at this time.
0 commit comments