[clang] [Tooling] Preserve backslashes in POSIX source paths (PR #207499)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 06:31:54 PDT 2026


================
@@ -260,7 +260,7 @@ llvm::Expected<std::string> getAbsolutePath(llvm::vfs::FileSystem &FS,
   SmallString<1024> AbsolutePath = RelativePath;
   if (auto EC = FS.makeAbsolute(AbsolutePath))
     return llvm::errorCodeToError(EC);
-  llvm::sys::path::native(AbsolutePath);
+  llvm::sys::path::make_preferred(AbsolutePath);
----------------
cor3ntin wrote:

This seems fine but  it also means that `native` can not be used at all with posix paths, on posix platforms.
I.E I don't think we have a way to holistically fix the issue - it might requires a deprecation of `native`, and I do not know if we should.


https://github.com/llvm/llvm-project/pull/207499


More information about the cfe-commits mailing list