about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-03-19 13:51:22 +0100
committerUrgau <urgau@numericable.fr>2024-03-28 18:47:26 +0100
commitee2898d3f1cbece34153581823fafa7f572bbff0 (patch)
tree6adcd3647b91cae40dcd75cf670f17b1a0267170 /compiler/rustc_codegen_llvm/src/debuginfo
parent106146fd958c3c0d3428cfc7be1f75c5bc81698f (diff)
downloadrust-ee2898d3f1cbece34153581823fafa7f572bbff0.tar.gz
rust-ee2898d3f1cbece34153581823fafa7f572bbff0.zip
Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 51179e66298..cd97929024a 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -838,9 +838,11 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>(
     codegen_unit_name: &str,
     debug_context: &CodegenUnitDebugContext<'ll, 'tcx>,
 ) -> &'ll DIDescriptor {
+    use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
     let mut name_in_debuginfo = tcx
         .sess
         .local_crate_source_file()
+        .map(|src| src.for_scope(&tcx.sess, RemapPathScopeComponents::DEBUGINFO).to_path_buf())
         .unwrap_or_else(|| PathBuf::from(tcx.crate_name(LOCAL_CRATE).as_str()));
 
     // To avoid breaking split DWARF, we need to ensure that each codegen unit
@@ -868,7 +870,6 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>(
     // FIXME(#41252) Remove "clang LLVM" if we can get GDB and LLVM to play nice.
     let producer = format!("clang LLVM ({rustc_producer})");
 
-    use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
     let name_in_debuginfo = name_in_debuginfo.to_string_lossy();
     let work_dir = tcx
         .sess