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

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 3 11:45:39 PDT 2023


jansvoboda11 added a comment.

Okay, I'll try to figure out how expensive this would be. I'd like Clang to be stricter in situations like these, but if that's not feasible, I'll probably implement the first workaround.

For the second workaround, I don't think that moves us in better direction - we should be able to assign one canonical real path to each `DirectoryEntry`.

The unfortunate aspect of the `ModuleMap::canonicalizeModuleMapPath()` implementation is that it uses `FileManager.getDirectoryRef(llvm::sys::path::parent_path(ModuleMapFilePath))`. If the request for getting the module map file fell through the VFS into the underlying FS, parent `DirectoryEntry` of that file is different than the virtual directory made for the VFS. Chopping off the file name and going through the VFS again doesn't guarantee falling through the VFS again, which that code doesn't account for. 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?


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