This is an archive of the discontinued LLVM Phabricator instance.

PCH: fix a regression that reports a module is defined in both pch and pcm
ClosedPublic

Authored by manmanren on Jan 6 2017, 2:40 PM.

Details

Summary

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 reports module 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 and also 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 textually included and the compiler knows that we are not building module X, so we don't put module X in SUBMODULE_DEFINITION of the pch.

Diff Detail

Repository
rL LLVM

Event Timeline

manmanren updated this revision to Diff 83431.Jan 6 2017, 2:40 PM
manmanren retitled this revision from to PCH: fix a regression that reports a module is defined in both pch and pcm.
manmanren updated this object.
manmanren added a subscriber: cfe-commits.
This revision was automatically updated to reflect the committed changes.