PCH: fix a regression that reports a module is defined in both pch and pcm.In r276159, we started to say that a module X is defined in a pch if we specify-fmodule-name when building the pch. This
PCH: fix a regression that reports a module is defined in both pch and pcm.In r276159, we started to say that a module X is defined in a pch if we specify-fmodule-name when building the pch. This caused a regression that reportsmodule X is defined in both pch and pcm if we generate the pch with-fmodule-name=X and then in a separate clang invocation, we include the pch andalso import X.pcm.This patch adds an option CompilingPCH similar to CompilingModule. When we use-fmodule-name=X while building a pch, modular headers in X will be textuallyincluded and the compiler knows that we are not building module X, so we don'tput module X in SUBMODULE_DEFINITION of the pch.Differential Revision: http://reviews.llvm.org/D28415llvm-svn: 291465
show more ...