From 0a4e9a3b25ceac87bede40e6b4f7cae01468a507 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 1 Oct 2014 17:14:57 +0000 Subject: C API: Add LLVMCloneModule() llvm-svn: 218775 --- llvm/lib/Transforms/Utils/CloneModule.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/Transforms/Utils') diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp index 3f75b3e677e..d078c96f372 100644 --- a/llvm/lib/Transforms/Utils/CloneModule.cpp +++ b/llvm/lib/Transforms/Utils/CloneModule.cpp @@ -17,6 +17,7 @@ #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Module.h" #include "llvm/Transforms/Utils/ValueMapper.h" +#include "llvm-c/Core.h" using namespace llvm; /// CloneModule - Return an exact copy of the specified module. This is not as @@ -122,3 +123,11 @@ Module *llvm::CloneModule(const Module *M, ValueToValueMapTy &VMap) { return New; } + +extern "C" { + +LLVMModuleRef LLVMCloneModule(LLVMModuleRef M) { + return wrap(CloneModule(unwrap(M))); +} + +} -- cgit v1.2.3