[PATCH] D31270: [wip] IR: Move linker options to top-level global metadata and remove dllexport storage class.

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 12:33:05 PDT 2017


rjmccall added a comment.

In https://reviews.llvm.org/D31270#710079, @pcc wrote:

> > Furthermore, by your account, this isn't even the representation we want to end up with. In the long term, we should completely fold dllimport and dllexport into symbol visibility.
>
> That isn't really my position though. dllexport is similar to symbol visibility, but does not have the same merging semantics (see discussion with Rafael).


It doesn't have the same merging semantics *as ELF*.  Mach-O uses the maximum visibility, the same as dllexport.

> dllimport can be seen as orthogonal to visibility, but I imagine that one possible alternative to https://reviews.llvm.org/D20217 would be to create a visibility that means "default but known DSO-local". So I can understand your perspective with regard to dllimport at least.

FWIW, you can hack around the lack of that visibility today by putting "hidden" on declarations and "default" on definitions.  Of course, this trick only works on strong definitions, and it relies on the IR linker discarding declarations without merging visibility, but it does work.  It would be better to have that explicit, though.


https://reviews.llvm.org/D31270





More information about the llvm-commits mailing list