diff options
| author | bors <bors@rust-lang.org> | 2023-12-14 05:29:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-14 05:29:55 +0000 |
| commit | 4a4a8966bd140a0e28d6a26c4e504514f2e7067a (patch) | |
| tree | c45eac208e30cda04a260493b0b9645faf52d73f /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | fda521a988749458326ecef2e92e979077727a4e (diff) | |
| parent | 7d4f92a309b67a04bcb5729f0420b21812ea8aef (diff) | |
| download | rust-4a4a8966bd140a0e28d6a26c4e504514f2e7067a.tar.gz rust-4a4a8966bd140a0e28d6a26c4e504514f2e7067a.zip | |
Auto merge of #3224 - rust-lang:rustup-2023-12-14, r=saethlin
Automatic Rustup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 98563673c30..acd5a1ff5c6 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -17,6 +17,7 @@ use crate::debuginfo::utils::FatPtrKind; use crate::llvm; use crate::llvm::debuginfo::{ DIDescriptor, DIFile, DIFlags, DILexicalBlock, DIScope, DIType, DebugEmissionKind, + DebugNameTableKind, }; use crate::value::Value; @@ -38,6 +39,7 @@ use rustc_span::FileName; use rustc_span::{FileNameDisplayPreference, SourceFile}; use rustc_symbol_mangling::typeid_for_trait_ref; use rustc_target::abi::{Align, Size}; +use rustc_target::spec::DebuginfoKind; use smallvec::smallvec; use libc::{c_char, c_longlong, c_uint}; @@ -878,6 +880,17 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>( let split_name = split_name.to_str().unwrap(); let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo); + let dwarf_version = + tcx.sess.opts.unstable_opts.dwarf_version.unwrap_or(tcx.sess.target.default_dwarf_version); + let is_dwarf_kind = + matches!(tcx.sess.target.debuginfo_kind, DebuginfoKind::Dwarf | DebuginfoKind::DwarfDsym); + // Don't emit `.debug_pubnames` and `.debug_pubtypes` on DWARFv4 or lower. + let debug_name_table_kind = if is_dwarf_kind && dwarf_version <= 4 { + DebugNameTableKind::None + } else { + DebugNameTableKind::Default + }; + unsafe { let compile_unit_file = llvm::LLVMRustDIBuilderCreateFile( debug_context.builder, @@ -907,6 +920,7 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>( kind, 0, tcx.sess.opts.unstable_opts.split_dwarf_inlining, + debug_name_table_kind, ); if tcx.sess.opts.unstable_opts.profile { |
