[PATCH] Change representation of dllexport/dllimport

Óscar Fuentes ofv at wanadoo.es
Sat Jul 6 02:51:24 PDT 2013


Stephen Lin <swlin at post.harvard.edu> writes:

> I'm somewhat new to this, so I might be mistaken about how attributes
> work, but since this new attribute only has meaningful semantics for
> Windows targets, wouldn't it make more sense to use a string-based
> target-dependent attribute (as described on
> "http://llvm.org/docs/HowToUseAttributes.html"?)

dllexport/dllimport is not target-dependent ("target" meaning "a LLVM
target") and IIRC it is used by other OSs than Windows (OS/2 or whatever
is named now, to name one.) The Windows group of OSs itself runs on at
least two LLVM targets: x86(_64) and ARM (PowerPC, Alpha and MIPS on the
past.) That list may grow in the future.

Finally, dllexport/dllimport is similar to features on other
OSes/toolchains. Visibility attributes on GCC, for instance. Maybe the
attribute can be used to (re)implement the visibility attribute, because
they are quite similar conceptually.




More information about the llvm-commits mailing list