[PATCH] D88721: [clangd][lit] Update document-link.test to respect custom resource-dir locations

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 05:05:08 PDT 2020


ArcsinX added a comment.

In D88721#2308296 <https://reviews.llvm.org/D88721#2308296>, @sammccall wrote:

>> As far as Windows accepts forward and back slashes
>
> Note we don't rely on windows itself for this support.
> All access through `llvm::sys::fs` APIs on windows ultimately goes through `widenPath` to convert to UTF-16, and this substitutes slashes.
> So LLVM tools do always support `/` on windows and it's fairly common to rely on this for tests (abstraction is hard in lit tests).

I am not sure that understood you correctly, but `widenPath` does nothing for me, if I pass mixed-slash path to it.
Code:

  std::string From("C:\\a/b\\c");
  SmallVector<wchar_t, 128> To;
  llvm::sys::windows::widenPath(From, To);
  std::wcerr << To.data();

Output:

  C:\a/b\c

So, if we imagine that Windows does not support `/`, then paths with `/` could not be opened with `llvm::sys::fs` API.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88721



More information about the cfe-commits mailing list