[PATCH] D122549: [VFS] RedirectingFileSystem only replace path if not already mapped

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 11:31:50 PDT 2022


dexonsmith added inline comments.


================
Comment at: clang/lib/Basic/FileManager.cpp:273
 
-  if (Status.getName() == Filename) {
+  if (!Status.IsVFSMapped) {
     // The name matches. Set the FileEntry.
----------------
An incremental patch you could try would be:
```
lang=c++
if (Status.getName() == Filename || !Status.IsVFSMapped)
```
... dropping all the other changes.

This limits the redirection hack to only apply when a RedirectingFS is involved (leaving until later the fine-tuning of when `IsVFSMapped` gets set). If this smaller change still causes a test failure, it might be easier to reason about why / how to fix it / be sure that the fix is sound.

Eventually we might want something like:
```
lang=c++
if (!Status.IsVFSMapped) {
  assert(Status.getName() == Filename);
```
I imagine that's not going to succeed yet due to the CWD behaviour in the VFSes, but as a speculative patch it might help track down whatever the problem is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122549



More information about the llvm-commits mailing list