Correctly set CompilingPCH in PrecompilePreambleAction.
authorAdam Czachorowski <adamcz@google.com>
Fri, 7 Aug 2020 15:08:38 +0000 (17:08 +0200)
committerAdam Czachorowski <adamcz@google.com>
Mon, 10 Aug 2020 15:49:23 +0000 (17:49 +0200)
commite2d61ae5733316a14783b36c84b8e7681b0e3d59
treeb92bdc92bc3bec523101e6b9c964932ebddcae17
parentf9500cc487573c55ea37b4ee6e9162d115753a48
Correctly set CompilingPCH in PrecompilePreambleAction.

This fixes a crash bug in clangd when used with modules. ASTWriter would
end up writing references to submodules into the PCH file, but upon
reading the submodules would not exists and
HeaderFileInfoTrait::ReadData would crash.

Differential Revision: https://reviews.llvm.org/D85532
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/ModulesTests.cpp [new file with mode: 0644]
clang/lib/Frontend/PrecompiledPreamble.cpp
clang/unittests/Frontend/ASTUnitTest.cpp