From 6d6203dff3560a2cc3ac8ec620ac3b105b0c7cc7 Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Mon, 8 Oct 2007 03:45:09 +0000 Subject: C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced the Objective Caml 'declare_*' functions to behave more or less like getOrInsertFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42740 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Core.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/VMCore') diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 66ab03c..bb55d4e 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -532,6 +532,10 @@ LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name) { GlobalValue::ExternalLinkage, 0, Name, unwrap(M))); } +LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name) { + return wrap(unwrap(M)->getNamedGlobal(Name)); +} + void LLVMDeleteGlobal(LLVMValueRef GlobalVar) { unwrap(GlobalVar)->eraseFromParent(); } @@ -576,6 +580,10 @@ LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name, GlobalValue::ExternalLinkage, Name, unwrap(M))); } +LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name) { + return wrap(unwrap(M)->getFunction(Name)); +} + void LLVMDeleteFunction(LLVMValueRef Fn) { unwrap(Fn)->eraseFromParent(); } -- cgit v1.1