diff --git a/clang/lib/Frontend/SARIFDiagnostic.cpp b/clang/lib/Frontend/SARIFDiagnostic.cpp index 2cd32ce97ea85..0179307bcbac3 100644 --- a/clang/lib/Frontend/SARIFDiagnostic.cpp +++ b/clang/lib/Frontend/SARIFDiagnostic.cpp @@ -219,7 +219,7 @@ llvm::StringRef SARIFDiagnostic::emitFilename(StringRef Filename, // on that system, both aforementioned paths point to the same place. #ifdef _WIN32 SmallString<256> TmpFilename = File->getName(); - llvm::sys::fs::make_absolute(TmpFilename); + SM.getFileManager().makeAbsolutePath(TmpFilename); llvm::sys::path::native(TmpFilename); llvm::sys::path::remove_dots(TmpFilename, /* remove_dot_dot */ true); Filename = StringRef(TmpFilename.data(), TmpFilename.size()); diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index 10032184b5d94..3f30709b0447e 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -835,7 +835,7 @@ void TextDiagnostic::emitFilename(StringRef Filename, const SourceManager &SM) { // on that system, both aforementioned paths point to the same place. #ifdef _WIN32 TmpFilename = File->getName(); - llvm::sys::fs::make_absolute(TmpFilename); + SM.getFileManager().makeAbsolutePath(TmpFilename); llvm::sys::path::native(TmpFilename); llvm::sys::path::remove_dots(TmpFilename, /* remove_dot_dot */ true); Filename = StringRef(TmpFilename.data(), TmpFilename.size());