[rfc] long term idea: remove appending linkage

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 6 08:36:01 PST 2015


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).

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


More information about the llvm-commits mailing list