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
commit106146fd958c3c0d3428cfc7be1f75c5bc81698f (patch)
tree97123f1a2ac2f788d59981dfc5856e2c71de2f2a /compiler/rustc_codegen_llvm/src/debuginfo
parent777c6b46cc804a3bae345f9133d2e0a900026bdc (diff)
downloadrust-106146fd958c3c0d3428cfc7be1f75c5bc81698f.tar.gz
rust-106146fd958c3c0d3428cfc7be1f75c5bc81698f.zip
Replace `RemapFileNameExt::for_codegen` with explicit calls
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index c24d9f3625b..51179e66298 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -554,13 +554,13 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
     ) -> &'ll DIFile {
         debug!(?source_file.name);
 
-        use rustc_session::RemapFileNameExt;
+        use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
         let (directory, file_name) = match &source_file.name {
             FileName::Real(filename) => {
                 let working_directory = &cx.sess().opts.working_dir;
                 debug!(?working_directory);
 
-                if cx.sess().should_prefer_remapped_for_codegen() {
+                if cx.sess().should_prefer_remapped(RemapPathScopeComponents::DEBUGINFO) {
                     let filename = cx
                         .sess()
                         .source_map()
@@ -623,7 +623,13 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
             }
             other => {
                 debug!(?other);
-                ("".into(), other.for_codegen(cx.sess()).to_string_lossy().into_owned())
+                (
+                    "".into(),
+                    other
+                        .for_scope(cx.sess(), RemapPathScopeComponents::DEBUGINFO)
+                        .to_string_lossy()
+                        .into_owned(),
+                )
             }
         };
 
@@ -862,9 +868,14 @@ 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::RemapFileNameExt;
+    use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
     let name_in_debuginfo = name_in_debuginfo.to_string_lossy();
-    let work_dir = tcx.sess.opts.working_dir.for_codegen(tcx.sess).to_string_lossy();
+    let work_dir = tcx
+        .sess
+        .opts
+        .working_dir
+        .for_scope(tcx.sess, RemapPathScopeComponents::DEBUGINFO)
+        .to_string_lossy();
     let output_filenames = tcx.output_filenames(());
     let split_name = if tcx.sess.target_can_use_split_dwarf() {
         output_filenames
@@ -875,7 +886,7 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>(
             )
             // We get a path relative to the working directory from split_dwarf_path
             .map(|f| {
-                if tcx.sess.should_prefer_remapped_for_codegen() {
+                if tcx.sess.should_prefer_remapped(RemapPathScopeComponents::DEBUGINFO) {
                     tcx.sess.source_map().path_mapping().map_prefix(f).0
                 } else {
                     f.into()