As progress towards having FileEntryRef contain the requested name of the file, this commit narrows the "remap" hack to only apply to paths that were remapped to an external contents path by a VFS. That was always the original intent of this code, and the fact it was making relative paths absolute was an unintended side effect.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Basic/FileManager.cpp | ||
---|---|---|
277–279 | Is it possible for an ExposesExternalVFSPath to have the same filename as the one that was requested? Just in the case of mapping A -> A or something equally pointless? Could check for that in the VFS, but probably doesn't matter in the long run. |
clang/lib/Basic/FileManager.cpp | ||
---|---|---|
277–279 | I think in practice it won't happen, but in theory the VFS can do whatever it wants, so I didn't want to introduce any possibility of circularity here. I will flip these checks so the boolean comes before the string compare though, since that will be cheaper. |
Is it possible for an ExposesExternalVFSPath to have the same filename as the one that was requested? Just in the case of mapping A -> A or something equally pointless? Could check for that in the VFS, but probably doesn't matter in the long run.