[clang] Make PCH's respect any VFS specified. (PR #106577)
Neil Henning via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 4 10:39:47 PDT 2024
sheredom wrote:
> I think it's something much earlier in clang is not using the VFS at all when looking up the main input path, so then it only knows the external path for that case. My guess is that if that were fixed then the ASTWriter/Reader would do the right thing here.
I don't think that would fix our problem though? We have:
- Build machine A with a path `E:/foo/header.h` which wants to make a PCH from it. We want it to remap `E:/foo` -> `Z:/fake`.
- Build machine B that *has no clue* where the original `header.h` file was on build machine A's filesystem. But we can tell it that the file is at `Z:/fake/header.h`. We can also remap that to our local version of the same file at `E:/bar/header.h`.
- This lets us share PCHs to significantly speed up our builds with Unreal Build Accelerator.
We need the PCH as created itself to *never* have `E:/foo` in any of the paths if we've specified this in the VFS. So we need the ASTWriter to do this remapping when it is creating the PCH.
If need be I can make the ASTWriter only do this remapping if we also had `"use-external-names": false` if that would make this easier?
https://github.com/llvm/llvm-project/pull/106577
More information about the cfe-commits
mailing list