[llvm-dev] LLVM_DYLIB and CLANG_DYLIB with MSVC

Tom Stellard via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 15 12:49:39 PDT 2021

On 6/15/21 11:00 AM, Reid Kleckner wrote:
> On Mon, Jun 14, 2021 at 10:49 AM Tom Stellard via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>     There is already the LLVM_EXTERNAL_VISIBILITY macro defined in
>     llvm/Support/Compiler.h macro which is used in llvm/lib/Target.
>     I would start using this one instead of creating a new LLVM_EXPORT macro.
>     We can always rename the macro later if people like the name LLVM_EXPORT
>     better.
> IMO we should go ahead and do a renaming and make project-specific headers. In the end, we need different macros for clang, lld, and llvm, and it seems wrong to put all of those in llvm/Support/Compiler.h.

Ok, this is fine with me too.


> Personally, I like the *_EXPORT name, but the other widely used convention is *_API. I think ICU uses that.
> Here are some examples of existing export header templates:
> https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html <https://cmake.org/cmake/help/latest/module/GenerateExportHeader.html>
> https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/exportheader.cmake.in <https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/exportheader.cmake.in>
> https://source.chromium.org/chromium/chromium/src/+/main:base/base_export.h;l=12?q=base_export%20&ss=chromium <https://source.chromium.org/chromium/chromium/src/+/main:base/base_export.h;l=12?q=base_export%20&ss=chromium>

More information about the llvm-dev mailing list