[clang] [CodeGen] Mark weak vtables unnamed_addr on duplicable-vtable targets (PR #205930)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 19:12:06 PDT 2026


ojhunt wrote:

> I didn't thought the linkage of vtable is related to targets.
> 
> > On Mach-O, a weak vtable that is unnamed_addr lowers to a .weak_def_can_be_hidden definition
> 
> Is this only possible on Mach-O? I mean, if this is an optimization, why didn't it work on other platforms?

It may be a matter of other platforms not having got around to it, or platform constraints make it less viable/valuable? It probably benefits platforms where mapped system libraries can be aggressively shared across many processes, but I'm not a linker person if I can help it.

https://github.com/llvm/llvm-project/pull/205930


More information about the cfe-commits mailing list