[llvm] [llvm-c] Guard include of llvm-config in Visibility.h (PR #154229)
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 19 15:05:36 PDT 2025
compnerd wrote:
> > The problem is that the configuration is not LLVMC, but LLVM itself. You need the configuration for the target libraries that it is creating bindings for.
>
> I think you are trying to solve a bigger problem than the one trying to fix here. For this PR, just want to achieve the same visibility granularity as `main` while try to break `llvm-c` out of the dependency of the big config file for c++ header.
I think that you are misunderstanding the code. The C++ header dependency is a requirement because the C interfaces call into the C++ interfaces.
> I don't know how people usually use llvm-c headers. I don't assume people will use c++ and c header together. I might consider split out all the functions that implements C interface into a separate lib `libLLVMC` and make that link other c++ libraries.
The llvm-c headers are used to actually use the C++ API from C. The C bindings are the only officially supported stable ABI. Separating the inline definitions this way would allow you to also remove the `llvm-config.h` header because the C++ APIs would no longer be inlined, but would come at a performance cost because you could no longer inline without LTO.
https://github.com/llvm/llvm-project/pull/154229
More information about the llvm-commits
mailing list