summaryrefslogtreecommitdiff
path: root/bindings/ocaml/llvm/llvm_ocaml.c
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2016-06-22 03:30:24 +0000
committerPeter Zotov <whitequark@whitequark.org>2016-06-22 03:30:24 +0000
commit98c9164467275be5a4f63dd7a1acecde39b27162 (patch)
treeb9937240598d5de1447c35c2d4517d0583341bbf /bindings/ocaml/llvm/llvm_ocaml.c
parent06dbef967776357611094d5abdebf18de0030cf8 (diff)
[OCaml] Add functions for accessing metadata nodes.
Patch by Xinyu Zhuang. Differential Revision: http://reviews.llvm.org/D19309 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml/llvm/llvm_ocaml.c')
-rw-r--r--bindings/ocaml/llvm/llvm_ocaml.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c
index 665842d0b6c..f968db8efd0 100644
--- a/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/bindings/ocaml/llvm/llvm_ocaml.c
@@ -734,6 +734,17 @@ CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
CAMLreturn(Val_int(0));
}
+CAMLprim value llvm_get_mdnode_operands(LLVMValueRef V) {
+ CAMLparam0();
+ CAMLlocal1(Operands);
+ unsigned int n;
+
+ n = LLVMGetMDNodeNumOperands(V);
+ Operands = alloc(n, 0);
+ LLVMGetMDNodeOperands(V, (LLVMValueRef *) Operands);
+ CAMLreturn(Operands);
+}
+
/* llmodule -> string -> llvalue array */
CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
{