[llvm] [llvm] annotate `LLVMCloneModule` for export (PR #145570)

Andrew Rogers via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 11:02:18 PDT 2025


================
@@ -216,8 +218,7 @@ std::unique_ptr<Module> llvm::CloneModule(
 
 extern "C" {
 
-LLVMModuleRef LLVMCloneModule(LLVMModuleRef M) {
+LLVM_ABI LLVMModuleRef LLVMCloneModule(LLVMModuleRef M) {
----------------
andrurogerz wrote:

@compnerd are there TUs that are specific to LLVM C, though? I don't see that. AFAICT, all of the public llvm-c functions are implemented throughout different libraries under `llvm/lib`. Though `LLVMCloneModule` is the only one implemented in `llvm/lib/Transforms`. 

I actually think the original PR where I added `#include "llvm-c/Core.h"` to this file is the best solution. There is precedent for that in `llvm/lib/IR/Core.cpp`.

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


More information about the llvm-commits mailing list