[llvm] [Support] Add clang tooling generated explicit visibility macros (PR #113097)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 17 12:23:54 PST 2024
================
----------------
nikic wrote:
> I just added a new macro LLVM_ABI_NOT_EXPORTED that the tool looks for, I never really though about reusing LIBRARY_VISIBILITY maybe i could. It would have to be not defined when the tool runs so the tool can define it as a clang annotate attribute it can find.
It would generally be nice if the old LLVM_EXTERNAL_VISIBILTY, LLVM_LIBRARY_VISIBILITY and LLVM_ALWAYS_EXPORT and the new macros could be consolidated. Having 3 old macros on top of 5 new ones really doesn't make it easy to understand when you're supposed to use which one.
And on that note, it would be great to have a section in https://llvm.org/docs/ProgrammersManual.html that explains the different ABI macros and when you're supposed to use them. As these are going to be become widespread now, having a reference that we can point people to will be helpful. (There is some limited documentation in Compiler.h, but it does lose nuances like the "only use if there is an out of line member" guideline mentioned above.)
https://github.com/llvm/llvm-project/pull/113097
More information about the llvm-commits
mailing list