This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] Disallow importing private framework in the implementation
ClosedPublic

Authored by jansvoboda11 on Jan 19 2023, 5:03 PM.

Details

Summary

Whenever we are compiling implementation of a framework (with the -fmodule-name=FW option), we never translate #import <FW/Header.h> to an import, regardless of whether "Header.h" belongs to "FW" or "FW_Private". For the same reasons, we also disallow @import FW. However, we still allow @import FW_Private. This patch disallows that a well, to be consistent with the rest of the rules.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jan 19 2023, 5:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 5:03 PM
jansvoboda11 requested review of this revision.Jan 19 2023, 5:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 5:03 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 added inline comments.Jan 19 2023, 5:04 PM
clang/lib/Sema/SemaModule.cpp
544

This is the functional change.

benlangmuir accepted this revision.Jan 20 2023, 10:53 AM
This revision is now accepted and ready to land.Jan 20 2023, 10:53 AM
This revision was landed with ongoing or failed builds.Jan 20 2023, 1:38 PM
This revision was automatically updated to reflect the committed changes.