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-22 15:27:17 +0100
committerUrgau <urgau@numericable.fr>2024-03-28 18:47:26 +0100
commitfefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba (patch)
treeb768c3b57ac8013ca10494c76b2a5ad85f9908b1 /compiler/rustc_codegen_llvm/src/debuginfo
parent4f4fa42b0ee1cf6c988d3f7ed6bcb4a51e788282 (diff)
downloadrust-fefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba.tar.gz
rust-fefb8f1f9cb830e1ca0b0ba449db7c8e7d4ff7ba.zip
Replace Session should_remap_filepaths with filename_display_preference
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 4dd51adc67b..e5fecddec52 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -554,13 +554,16 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
     ) -> &'ll DIFile {
         debug!(?source_file.name);
 
-        use rustc_session::{config::RemapPathScopeComponents, RemapFileNameExt};
+        let filename_display_preference =
+            cx.sess().filename_display_preference(RemapPathScopeComponents::DEBUGINFO);
+
+        use rustc_session::config::RemapPathScopeComponents;
         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(RemapPathScopeComponents::DEBUGINFO) {
+                if filename_display_preference == FileNameDisplayPreference::Remapped {
                     let filename = cx
                         .sess()
                         .source_map()
@@ -623,13 +626,7 @@ pub fn file_metadata<'ll>(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) ->
             }
             other => {
                 debug!(?other);
-                (
-                    "".into(),
-                    other
-                        .for_scope(cx.sess(), RemapPathScopeComponents::DEBUGINFO)
-                        .to_string_lossy()
-                        .into_owned(),
-                )
+                ("".into(), other.display(filename_display_preference).to_string())
             }
         };