[PATCH] D135849: [llvm] Return canonical virtual path from `RedirectingFileSystem`

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 11:47:58 PDT 2023


jansvoboda11 added a comment.

In D135849#4469376 <https://reviews.llvm.org/D135849#4469376>, @benlangmuir wrote:

> In D135849#4469347 <https://reviews.llvm.org/D135849#4469347>, @jansvoboda11 wrote:
>
>> It'd be really nice to have DirectoryEntry::getDir() API, so that we can walk up the directory hierarchy while preserving the virtual/real distinction between directories in the overlay/on disk, never accidentally "bubbling up" into the overlay again. What's your take on that?
>
> Can you say more about how you would do this and preserve the real/virtual distinction? Currently FileManager is just filling in the directory based on the parent path with a lookup to the VFS, so isn't it the same issue? Or did you mean we would keep more info?

Yes, the mechanism you mention has the same issue. My idea was that we could keep more information when looking up the path in the VFS, associate each `{File,Directory}Entry` with list of `FileSystem *` that "owns" each of its parent directories. We could then send the `llvm::sys::path::parent_path(...)` argument directly to the owning FS instead to the top one. This is not realistic from performance standpoint, though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135849



More information about the cfe-commits mailing list