make -fmodules-codegen and -fmodules-debuginfo work also with PCHs
authorLuboš Luňák <l.lunak@centrum.cz>
Sun, 3 Nov 2019 20:15:03 +0000 (21:15 +0100)
committerLuboš Luňák <l.lunak@centrum.cz>
Tue, 14 Jan 2020 23:01:08 +0000 (00:01 +0100)
commitcbc9d22e49b434b6ceb2eb94b67079d02e0a7b74
tree4ca09fdd49b20ff9b144dc1a4229cb54396de63f
parentb5b2cf7af47f1ca04635dae7b787c8a81d5af4c9
make -fmodules-codegen and -fmodules-debuginfo work also with PCHs

Allow to build PCH's (with -building-pch-with-obj and the extra .o file)
with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code
into the extra .o file, similarly to how it works with modules. A bit of
a misnomer, but the underlying functionality is the same. This saves up
to 20% of build time here.

Differential Revision: https://reviews.llvm.org/D69778
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/Modules/Inputs/codegen-flags/foo.h
clang/test/PCH/codegen.cpp [new file with mode: 0644]