[llvm] [llvm] annotate interfaces in AsmParser, BinaryFormat, Bitcode, and Bitstream libraries for DLL export (PR #141794)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 22:08:56 PDT 2025


================
@@ -120,7 +121,7 @@ namespace llvm {
 extern FunctionSummary::ForceSummaryHotnessType ForceSummaryEdgesCold;
 }
 
-extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
+LLVM_ABI extern llvm::cl::opt<bool> UseNewDbgInfoFormat;
----------------
compnerd wrote:

Right, the standard annotation can only appear in certain locations. As far as clang is concerned, the standard and GNU spellings are identical, just spelling differences and of course parsing due to the position handling for standard specifiers.

I think that using the extended GNU spelling (`__attribute__((__visibility__("default")))` is reasonable and should be preferred. That should hopefully also simplify the definition logic and will hopefully remove the need for the `LLVM_ABI_FRIEND` macro.

https://github.com/llvm/llvm-project/pull/141794


More information about the llvm-commits mailing list