This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] Skip submodule & framework re-definitions in module maps
ClosedPublic

Authored by jansvoboda11 on May 12 2023, 1:42 PM.

Details

Summary

Before D150478, there were situations when Clang avoided parsing a module map because it was likely to re-define an already defined module (either by a PCM or by previously-found module map). Since Clang no longer performs that check and does parse the extra module map (due to the FW/FW_Private issue described in D150478), this patch re-implements the same semantics by skipping the duplicate definition of the framework module while parsing the module map.

Depends on D150478.

Diff Detail

Event Timeline

jansvoboda11 created this revision.May 12 2023, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 1:42 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.May 12 2023, 1:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 1:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir added inline comments.May 15 2023, 11:31 AM
clang/test/ClangScanDeps/modules-private-framework-submodule.c
43 ↗(On Diff #521783)

Does this lose any test coverage for the FW2_Private case?

jansvoboda11 added inline comments.May 15 2023, 11:39 AM
clang/test/ClangScanDeps/modules-private-framework-submodule.c
43 ↗(On Diff #521783)

This still tests the same general code path, just a more specific case of it. I can keep this test as is and create new one specifically to test the "explicit submodule" case if that makes more sense to you.

benlangmuir added inline comments.May 15 2023, 11:40 AM
clang/test/ClangScanDeps/modules-private-framework-submodule.c
43 ↗(On Diff #521783)

Yeah, my preference would be to add a case instead of modifying this one, unless there is somewhere else we're already testing the same thing. The exact behaviour of FW2.Private vs FW2_Private vs FW2Private is all subtlely different

jansvoboda11 retitled this revision from [clang][modules][deps] Allow skipping submodule definitions to [clang][modules] Skip submodule & framework re-definitions in module maps.Jul 11 2023, 9:33 AM
jansvoboda11 edited the summary of this revision. (Show Details)

Skip re-definitions of frameworks too, add new tests

benlangmuir accepted this revision.Jul 13 2023, 2:29 PM
This revision is now accepted and ready to land.Jul 13 2023, 2:29 PM
This revision was landed with ongoing or failed builds.Jul 17 2023, 1:51 PM
This revision was automatically updated to reflect the committed changes.