Skip to content

[llvm] annotate LLVMCloneModule for export #145570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/Utils/CloneModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@

#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/ValueMapper.h"

using namespace llvm;

namespace llvm {
Expand Down Expand Up @@ -216,8 +218,7 @@ std::unique_ptr<Module> llvm::CloneModule(

extern "C" {

LLVMModuleRef LLVMCloneModule(LLVMModuleRef M) {
LLVM_ABI LLVMModuleRef LLVMCloneModule(LLVMModuleRef M) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this only export now if you build llvm as a DLL? The use of the visibility header is fine. Bleh, I think that I missed that this was in the implementation of the llvm-c technically. If this function is not used elsewhere, I'd suggest just moving this function into a new TU in LLVM C.

return wrap(CloneModule(*unwrap(M)).release());
}

}