1
Fork 0

Revamp RealFileName public methods

This commit is contained in:
Andy Wang 2021-04-14 14:12:39 +01:00 committed by Andy Wang
parent f8e55da6de
commit fb4f6439f6
No known key found for this signature in database
GPG key ID: 181B49F9F38F3374
7 changed files with 53 additions and 41 deletions

View file

@ -764,7 +764,7 @@ pub fn file_metadata(cx: &CodegenCx<'ll, '_>, source_file: &SourceFile) -> &'ll
let hash = Some(&source_file.src_hash);
let file_name = Some(source_file.name.to_string());
let directory = if source_file.is_real_file() && !source_file.is_imported() {
Some(cx.sess().working_dir.stable_name().to_string_lossy().to_string())
Some(cx.sess().working_dir.to_string_lossy(false).to_string())
} else {
// If the path comes from an upstream crate we assume it has been made
// independent of the compiler's working directory one way or another.
@ -992,7 +992,7 @@ pub fn compile_unit_metadata(
let producer = format!("clang LLVM ({})", rustc_producer);
let name_in_debuginfo = name_in_debuginfo.to_string_lossy();
let work_dir = tcx.sess.working_dir.stable_name().to_string_lossy();
let work_dir = tcx.sess.working_dir.to_string_lossy(false);
let flags = "\0";
let out_dir = &tcx.output_filenames(LOCAL_CRATE).out_directory;
let split_name = if tcx.sess.target_can_use_split_dwarf() {