[PATCH] D76869: [Clang] Restore replace_path_prefix instead of startswith

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 09:02:48 PDT 2020


amccarth added a comment.

Background:

The `llvm::sys::Path` functions are designed to deal with paths that are either Posix-style or (a subset of) Windows styles.  We also have the virtual file system (VFS), specifically the redirecting file system, which can truly be hybrids, mixing Posix with Windows styles in a single path.

Attempts to canonicalize VFS paths to one or the other wasn't feasible.  It would require many tests to be duplicated for Posix or Windows.  Since one of the benefits of VFS is to write single tests that work on both file systems, this didn't seem the right way to go.  Furthermore, the general clang approach to file paths is not to canonicalize but to blindly concatenate.

I got nearly all of the VFS tests, and several others, working on Windows mostly by intentionally avoiding the `llvm::sys::Path` APIs when the path in question may be one of these hybrid styles.

I'll take a closer look at the details in this patch later today.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76869/new/

https://reviews.llvm.org/D76869





More information about the llvm-commits mailing list