Index: llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c =================================================================== --- llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c +++ llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c @@ -369,6 +369,14 @@ Wosize_val(Data)); } +CAMLprim LLVMMetadataRef llvm_dibuild_get_or_create_array(value Builder, + value Data) { + + return LLVMDIBuilderGetOrCreateArray(DIBuilder_val(Builder), + (LLVMMetadataRef *)Op_val(Data), + Wosize_val(Data)); +} + CAMLprim LLVMMetadataRef llvm_dibuild_create_subroutine_type( value Builder, LLVMMetadataRef File, value ParameterTypes, value Flags) { Index: llvm/bindings/ocaml/debuginfo/llvm_debuginfo.ml =================================================================== --- llvm/bindings/ocaml/debuginfo/llvm_debuginfo.ml +++ llvm/bindings/ocaml/debuginfo/llvm_debuginfo.ml @@ -262,6 +262,10 @@ lldibuilder -> data:Llvm.llmetadata array -> Llvm.llmetadata = "llvm_dibuild_get_or_create_type_array" +external dibuild_get_or_create_array : + lldibuilder -> data:Llvm.llmetadata array -> Llvm.llmetadata + = "llvm_dibuild_get_or_create_array" + external dibuild_create_subroutine_type : lldibuilder -> file:Llvm.llmetadata -> Index: llvm/bindings/ocaml/debuginfo/llvm_debuginfo.mli =================================================================== --- llvm/bindings/ocaml/debuginfo/llvm_debuginfo.mli +++ llvm/bindings/ocaml/debuginfo/llvm_debuginfo.mli @@ -282,6 +282,11 @@ (** [dibuild_get_or_create_type_array] Create a type array. See LLVMDIBuilderGetOrCreateTypeArray. *) +val dibuild_get_or_create_array : + lldibuilder -> data:Llvm.llmetadata array -> Llvm.llmetadata +(** [dibuild_get_or_create_array] Create an array of DI Nodes. + See LLVMDIBuilderGetOrCreateArray. *) + val dibuild_create_constant_value_expression : lldibuilder -> int -> Llvm.llmetadata (** [dibuild_create_constant_value_expression] Create a new descriptor for Index: llvm/test/Bindings/OCaml/debuginfo.ml =================================================================== --- llvm/test/Bindings/OCaml/debuginfo.ml +++ llvm/test/Bindings/OCaml/debuginfo.ml @@ -339,7 +339,7 @@ ~align_in_bits:0 ~elements ~class_ty:int64_ty_di in let elements_arr = - Llvm_debuginfo.dibuild_get_or_create_type_array dibuilder ~data:elements + Llvm_debuginfo.dibuild_get_or_create_array dibuilder ~data:elements in stdout_metadata elements_arr; (* CHECK: [[ELEMENTS_PTR:<0x[0-9a-f]*>]] = !{[[ENUMERATOR1_PTR]], [[ENUMERATOR2_PTR]], [[ENUMERATOR3_PTR]]}