about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
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/back/write.rs
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/back/write.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index d27df052d43..4efea66a7f1 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -258,19 +258,17 @@ pub fn target_machine_factory(
     };
     let debuginfo_compression = SmallCStr::new(&debuginfo_compression);
 
-    let should_prefer_remapped_paths =
-        sess.should_prefer_remapped(RemapPathScopeComponents::DEBUGINFO);
+    let file_name_display_preference =
+        sess.filename_display_preference(RemapPathScopeComponents::DEBUGINFO);
 
     Arc::new(move |config: TargetMachineFactoryConfig| {
         let path_to_cstring_helper = |path: Option<PathBuf>| -> CString {
             let path = path.unwrap_or_default();
-            let path = path_mapping.to_real_filename(path);
-            let path = if should_prefer_remapped_paths {
-                path.remapped_path_if_available()
-            } else {
-                path.local_path_if_available()
-            };
-            CString::new(path.to_str().unwrap()).unwrap()
+            let path = path_mapping
+                .to_real_filename(path)
+                .to_string_lossy(file_name_display_preference)
+                .into_owned();
+            CString::new(path).unwrap()
         };
 
         let split_dwarf_file = path_to_cstring_helper(config.split_dwarf_file);