This is an archive of the discontinued LLVM Phabricator instance.

[C++20] [Modules] Handle initializer for Header Units
ClosedPublic

Authored by ChuanqiXu on Aug 1 2022, 12:18 AM.

Details

Summary

Previously when we add module initializer, we forget to handle header units. This results that we couldn't compile a Hello World Example with Header Units. This patch tries to fix this.

Diff Detail

Event Timeline

ChuanqiXu created this revision.Aug 1 2022, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 12:18 AM
ChuanqiXu requested review of this revision.Aug 1 2022, 12:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 12:18 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ChuanqiXu added inline comments.Aug 1 2022, 12:22 AM
clang/lib/CodeGen/CodeGenModule.cpp
2524–2525

See the example about M.cppm.

iains accepted this revision.Aug 1 2022, 3:06 PM

LGTM, one small point about the test,

clang/test/CodeGenCXX/module-initializer-header.cppm
5–7

you could use -triple %itanium_abi_triple which would increase the test coverage to other titanium platforms.

This revision is now accepted and ready to land.Aug 1 2022, 3:06 PM
This revision was automatically updated to reflect the committed changes.