[clang][modules] Don't prevent translation of FW_Private includes when explicitly building FW (#70714) #7732
+125
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We prevent translating
#include <FW/PrivateHeader.h>
into an import of FW_Private when compiling the implementation of FW or FW_Private. This is specified via-fmodule-name=
on the TU command line (used to be-fmodule-implementation-of
).This logic is supposed to only kick in when imported directly from a TU, but it currently also kicks in when compiling the public FW module explicitly (since it also has
-fmodule-name=
on the command line).This patch makes sure this logic only kicks in for the case that used to be
-fmodule-implementation-of
(for the TU), and not for all-fmodule-name=
cases (especially for the explicit compile of a module).rdar://101051277; related: rdar://37500098&38434694 (cherry picked from commit a3efd89)