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

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 19:11:36 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);
----------------
zeyi2 wrote:

Yeah, I agree that this points to a broader concern with `native`. That said, I’m not sure this PR is the right place to settle the API question or the possible deprecation path. I filed a separate issue to track that discussion: https://github.com/llvm/llvm-project/issues/207885


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


More information about the cfe-commits mailing list