[PATCH] Change representation of dllexport/dllimport

Stephen Lin swlin at post.harvard.edu
Sat Jul 6 03:04:37 PDT 2013


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

Yes, I'm aware and I thought about proactively mentioning that.
Basically, regardless of how you define "target", the attributes as
currently defined don't seem to have any meaningful semantics in most
compilation configurations so it doesn't really seem necessary to
promote them to target-indepedent attributes (which, for the most
part, concern semantics that all targets and configurations must
ostensibly handle.

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

If it's really the same thing, then it seems better to rename it to
something which is platform neutral and simply have it map to
dllexport/dllimport for Windows targets.

If that's not appropriate, however, then it's all the more reason to
make it a string-based attribute; otherwise, every type of visibility
supported by every type of OS would have to get its own LLVM IR
keywords, each of which would individually only be relevant for a
minority of compilation configurations.

Stephen



More information about the llvm-commits mailing list