[rfc] long term idea: remove appending linkage

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 6 09:43:17 PST 2015


On Sunday, December 6, 2015, Rafael EspĂ­ndola <llvm-commits at lists.llvm.org>
wrote:

> Looking at how unique appending linkage handling is I started
> wondering if we still need it at all.
>
> Now that we have sections, private linkage and comdats, I don't think we
> do.
>
> Things like
>
>  @llvm.global_ctors = ... { i32 A1, i32 B1, i8* C1 }, { i32 A2, i32 B2,
> i8* C2 }
>
> can be represented as
>
> @ctor1 = private ... { i32 A1, i32 B1 }, section
> "llvm.metadata.ctors", comdat $(comdat of C1).
> @ctor2 = private ... { i32 A2, i32 B2 }, section
> "llvm.metadata.ctors", comdat $(comdat of C2).


This wouldn't work on Mach-O because it doesn't have COMDATs.

Sorry for the brevity, sent from my phone.


>
> Which has a few advantages:
>
> * It links just like every other IR.
> * It representation matches what is actually done in the object file.
> Currently the representation has different meaning if C is not in a
> comdat.
>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <javascript:;>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151206/ebc8a82d/attachment.html>


More information about the llvm-commits mailing list