This is an archive of the discontinued LLVM Phabricator instance.

[C++20][Modules] Limit ModuleInternalLinkage to modules-ts.
ClosedPublic

Authored by iains on Mar 24 2022, 9:48 AM.

Details

Summary

At present, we are generating wrong code for C++20 modules entities which
should have internal linkage. This is because we are assigning
'ModuleInternalLinkage' unconditionally to such entities. However this mode
is only applicable to the modules-ts.

This change makes the special linkage mode conditional on fmodules-ts and
adds a unit test to verify that we generate the correct linkage.

Currently, static variables and functions in module purview are emitted into
object files as external. On some platforms, lambdas are emitted as global
weak defintions (on Windows this causes a mangler crash).

Diff Detail