[PATCH] D52209: [LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral
whitequark via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 17 18:51:47 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL342435: [LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral (authored by whitequark, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D52209
Files:
llvm/trunk/bindings/ocaml/llvm/llvm.ml
llvm/trunk/bindings/ocaml/llvm/llvm.mli
llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
llvm/trunk/include/llvm-c/Core.h
llvm/trunk/lib/IR/Core.cpp
Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -706,6 +706,10 @@
return unwrap<StructType>(StructTy)->isOpaque();
}
+LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy) {
+ return unwrap<StructType>(StructTy)->isLiteral();
+}
+
LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {
return wrap(unwrap(M)->getTypeByName(Name));
}
Index: llvm/trunk/bindings/ocaml/llvm/llvm.mli
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli
@@ -665,6 +665,10 @@
[false] otherwise. See the method [llvm::StructType::isOpaque]. *)
val is_opaque : lltype -> bool
+(** [is_literal sty] returns [true] if the structure type [sty] is literal.
+ [false] otherwise. See the method [llvm::StructType::isLiteral]. *)
+val is_literal : lltype -> bool
+
(** {7 Operations on pointer, vector, and array types} *)
Index: llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
+++ llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c
@@ -510,6 +510,11 @@
return Val_bool(LLVMIsOpaqueStruct(StructTy));
}
+/* lltype -> bool */
+CAMLprim value llvm_is_literal(LLVMTypeRef StructTy) {
+ return Val_bool(LLVMIsLiteralStruct(StructTy));
+}
+
/*--... Operations on array, pointer, and vector types .....................--*/
/* lltype -> lltype array */
Index: llvm/trunk/bindings/ocaml/llvm/llvm.ml
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml
@@ -469,6 +469,7 @@
= "llvm_struct_element_types"
external is_packed : lltype -> bool = "llvm_is_packed"
external is_opaque : lltype -> bool = "llvm_is_opaque"
+external is_literal : lltype -> bool = "llvm_is_literal"
(*--... Operations on pointer, vector, and array types .....................--*)
Index: llvm/trunk/include/llvm-c/Core.h
===================================================================
--- llvm/trunk/include/llvm-c/Core.h
+++ llvm/trunk/include/llvm-c/Core.h
@@ -1279,6 +1279,13 @@
LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy);
/**
+ * Determine whether a structure is literal.
+ *
+ * @see llvm::StructType::isLiteral()
+ */
+LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
+
+/**
* @}
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52209.165882.patch
Type: text/x-patch
Size: 2559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/d1316bb4/attachment.bin>
More information about the llvm-commits
mailing list