[OCaml] Expose Llvm_executionengine.get_{global_value,function}_address.

Patch by Ramkumar Ramachandra <artagnon@gmail.com>.

Also remove Llvm_executionengine.get_pointer_to_global, as it
is actually deprecated and didn't appear in a stable release.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Zotov
2014-12-24 01:52:51 +00:00
parent 43e17cfe85
commit 0357f8735e
4 changed files with 49 additions and 17 deletions

View File

@@ -115,8 +115,12 @@ CAMLprim value llvm_ee_add_global_mapping(LLVMValueRef Global, value Ptr,
return Val_unit;
}
/* Llvm.llvalue -> llexecutionengine -> int64 */
CAMLprim value llvm_ee_get_pointer_to_global(LLVMValueRef Global,
LLVMExecutionEngineRef EE) {
return caml_copy_int64((int64_t) LLVMGetPointerToGlobal(EE, Global));
CAMLprim value llvm_ee_get_global_value_address(value Name,
LLVMExecutionEngineRef EE) {
return caml_copy_int64((int64_t) LLVMGetGlobalValueAddress(EE, String_val(Name)));
}
CAMLprim value llvm_ee_get_function_address(value Name,
LLVMExecutionEngineRef EE) {
return caml_copy_int64((int64_t) LLVMGetFunctionAddress(EE, String_val(Name)));
}