[PATCH] D95188: [VFS] Fix inconsistencies between relative paths and fallthrough in the RedirectingFileSystem

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 19:47:54 PST 2021


JDevlieghere added inline comments.


================
Comment at: llvm/lib/Support/VirtualFileSystem.cpp:1754
-  // but canonicalize in order to perform the correct entry search.
-  Path = canonicalize(Path);
-  if (Path.empty())
----------------
dexonsmith wrote:
> Is there a reason you had to manually inline `canonicalize()` here? It'd be nice to reuse the logic, since it's not entirely obvious.
I was trying to avoid the copy into the SmallString, but that didn't work out because you need a buffer to copy from (otherwise you're copying from yourself). We could add an overload to `remove_leading_dotslash` that performs the operation in-place, but that would be for a separate patch.  


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

https://reviews.llvm.org/D95188



More information about the llvm-commits mailing list