aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Object/ELFObjectFileTest.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-12-02 15:43:48 -0800
committerJan Svoboda <jan_svoboda@apple.com>2022-12-02 16:12:16 -0800
commit40472ef14cd3bbed665789825b47d055e0a83402 (patch)
treef6050f2a4cd57f4368912e1b2b50e87478fe3d94 /llvm/unittests/Object/ELFObjectFileTest.cpp
parent5ea0ba2c13af3c6c8e68701b00695f0f0481bed0 (diff)
downloadllvm-40472ef14cd3bbed665789825b47d055e0a83402.zip
llvm-40472ef14cd3bbed665789825b47d055e0a83402.tar.gz
llvm-40472ef14cd3bbed665789825b47d055e0a83402.tar.bz2
[clang][modules] Serialize VFS overlay paths into PCMs
With implicitly built modules, the importing `CompilerInstance` assumes PCMs were built in a "compatible way" (i.e. with similarly set up instance). Either because their context hash matches, or because this instance has just built them. There are some use-cases, however, where this assumption doesn't hold, libclang/c-index-test being one of them. There, the importing instance (or `ASTUnit`) is being set up while the PCM file is being deserialized. Until now, we've assumed the serialized paths to input files are the actual on-disk files, meaning the default physical VFS was always able to resolve them. This won't be the case after D135636. Therefore, this patch makes sure `ASTUnit` is initialized with the same VFS as the PCM it's deserializing - by storing paths to the VFS overlay files into the PCM itself. For the VFS overlay files to be adopted at the very start of PCM deserialization, they are stored in a new section in the unhashed control block, together with header search paths and system header prefixes. The move to the unhashed control block should be safe: if two modules were built with different header search paths and they produced different results, the hashed part of the PCM file will reflect that. Reviewed By: akyrtzi, benlangmuir Differential Revision: https://reviews.llvm.org/D135634
Diffstat (limited to 'llvm/unittests/Object/ELFObjectFileTest.cpp')
0 files changed, 0 insertions, 0 deletions