[PATCH] D119409: [C++20] [Modules] Remain dynamic initializing internal-linkage variables in module interface unit

Nathan Sidwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 18 10:28:54 PST 2022


urnathan added a comment.

In D119409#3332313 <https://reviews.llvm.org/D119409#3332313>, @dblaikie wrote:

> 

That's interesting data.  I guess one could emit the out-of-line bodies into their own sections, and then rely on linker section GC to elide them in the static link.  But if you're building an SO, you presumably need to provide them unilaterally in the static link, and callers would use a PLT to get to them.  One could continue emitting them COMDAT, and unilaterally emit them in the module interface's object file, but that will still leave the SO problem.  I think.

> I'm not sure if Richard Smith made a choice about not homing inline functions in C++20 modules because of these results, or for other reasons, or just as a consequence of the implementation -

Richard and I discussed taking advantage of this kind of new home location, certainly for key-less polymorphic classes.  I was against it as it was more work :) Blame me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119409/new/

https://reviews.llvm.org/D119409



More information about the cfe-commits mailing list