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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to