[PATCH] D135499: [llvm-ocaml] Revise OCaml opaque pointer bindings to match rest of API
Alan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 7 17:46:32 PDT 2022
alan updated this revision to Diff 466229.
alan added a comment.
Make doc comment of `pointer_type2` refer to `getUnqual`, not `get`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135499/new/
https://reviews.llvm.org/D135499
Files:
llvm/bindings/ocaml/llvm/llvm.ml
llvm/bindings/ocaml/llvm/llvm.mli
llvm/bindings/ocaml/llvm/llvm_ocaml.c
llvm/test/Bindings/OCaml/core.ml
Index: llvm/test/Bindings/OCaml/core.ml
===================================================================
--- llvm/test/Bindings/OCaml/core.ml
+++ llvm/test/Bindings/OCaml/core.ml
@@ -43,8 +43,9 @@
(*===-- Pointer types ----------------------------------------------------===*)
let test_pointer_types () =
- insist (address_space (pointer_type_in_context context 0) = 0);
- insist (address_space (pointer_type_in_context context 1) = 1)
+ insist (address_space (pointer_type2 context) = 0);
+ insist (address_space (qualified_pointer_type2 context 0) = 0);
+ insist (address_space (qualified_pointer_type2 context 1) = 1)
(*===-- Conversion --------------------------------------------------------===*)
Index: llvm/bindings/ocaml/llvm/llvm_ocaml.c
===================================================================
--- llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -581,8 +581,13 @@
return LLVMPointerType(ElementTy, Int_val(AddressSpace));
}
+/* llcontext -> lltype */
+LLVMTypeRef llvm_pointer_type2(LLVMContextRef C, value AddressSpace) {
+ return LLVMPointerTypeInContext(C, 0);
+}
+
/* llcontext -> int -> lltype */
-LLVMTypeRef llvm_pointer_type_in_context(LLVMContextRef C, value AddressSpace) {
+LLVMTypeRef llvm_qualified_pointer_type2(LLVMContextRef C, value AddressSpace) {
return LLVMPointerTypeInContext(C, Int_val(AddressSpace));
}
Index: llvm/bindings/ocaml/llvm/llvm.mli
===================================================================
--- llvm/bindings/ocaml/llvm/llvm.mli
+++ llvm/bindings/ocaml/llvm/llvm.mli
@@ -721,15 +721,20 @@
See the method [llvm::PointerType::getUnqual]. *)
val pointer_type : lltype -> lltype
-(** [qualified_pointer_type ty as] returns the pointer type referencing objects
- of type [ty] in address space [as].
+(** [qualified_pointer_type ty a] returns the pointer type referencing objects
+ of type [ty] in address space [a].
See the method [llvm::PointerType::get]. *)
val qualified_pointer_type : lltype -> int -> lltype
-(** [pointer_type_in_context context as] returns the opaque pointer type
- referencing objects in address space [as].
+(** [pointer_type2 context] returns the pointer type in the default
+ address space (0).
+ See the method [llvm::PointerType::getUnqual]. *)
+val pointer_type2 : llcontext -> lltype
+
+(** [qualified_pointer_type2 context a] returns the pointer type referencing
+ objects in address space [a].
See the method [llvm::PointerType::get]. *)
-val pointer_type_in_context : llcontext -> int -> lltype
+val qualified_pointer_type2 : llcontext -> int -> lltype
(** [vector_type ty n] returns the array type containing [n] elements of the
primitive type [ty]. See the method [llvm::ArrayType::get]. *)
Index: llvm/bindings/ocaml/llvm/llvm.ml
===================================================================
--- llvm/bindings/ocaml/llvm/llvm.ml
+++ llvm/bindings/ocaml/llvm/llvm.ml
@@ -508,8 +508,9 @@
external pointer_type : lltype -> lltype = "llvm_pointer_type"
external qualified_pointer_type : lltype -> int -> lltype
= "llvm_qualified_pointer_type"
-external pointer_type_in_context : llcontext -> int -> lltype
- = "llvm_pointer_type_in_context"
+external pointer_type2 : llcontext -> lltype = "llvm_pointer_type2"
+external qualified_pointer_type2 : llcontext -> int -> lltype
+ = "llvm_qualified_pointer_type2"
external vector_type : lltype -> int -> lltype = "llvm_vector_type"
external element_type : lltype -> lltype = "LLVMGetElementType"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135499.466229.patch
Type: text/x-patch
Size: 3657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221008/475d9dad/attachment.bin>
More information about the llvm-commits
mailing list