[LLVMdev] Feedback required on proper dllexport/import implementation

Anton Korobeynikov
Wed, 27 Mar 2013 20:39:32 -0000

Hi Nico,

We already discussed this on IRC, I just wanted to mention something explicitly.

> 1. Add additional linkage type(s) for the combinations to
>    GlobalValue::LinkageTypes.
>
>    This appears to be the least invasive way, but adds new linkage types
>    to an already large list.
It also will require modifying all the existing code wrt linkonce
semantics of "dllexpport_odr" and "dllimport_odr" stuff.
Which might
be nontrivial (it's hard to say anything in advance).

After all dllexport is basically the same as external linkage and
dllimport - as  well (but just decl). So, instead of adding new
entities here we'd think about the overall picture once again and make
dllexport / dllimport as some sort of flags?

Target-specific attributes seems the best solution here, but they
cannot be applied to globals. Maybe we'd think into this direction?

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University