diff options
| author | whitequark <whitequark@whitequark.org> | 2018-09-18 01:47:37 +0000 |
|---|---|---|
| committer | whitequark <whitequark@whitequark.org> | 2018-09-18 01:47:37 +0000 |
| commit | b486107c208e08e67d6703c8180e66d648c767aa (patch) | |
| tree | bbb64e2a8cd9bb6c8cdecd5b6b7dc7fd3f3c7660 /llvm/bindings | |
| parent | 6c1f7a51b9e12e143bc2660c22293172f86ea014 (diff) | |
| download | bcm5719-llvm-b486107c208e08e67d6703c8180e66d648c767aa.tar.gz bcm5719-llvm-b486107c208e08e67d6703c8180e66d648c767aa.zip | |
[LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral
Summary:
This patch adds LLVMIsLiteralStruct to the C API to expose
StructType::isLiteral. This is then used to implement the analogous
addition to the OCaml API.
Reviewers: whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52209
llvm-svn: 342435
Diffstat (limited to 'llvm/bindings')
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm.ml | 1 | ||||
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm.mli | 4 | ||||
| -rw-r--r-- | llvm/bindings/ocaml/llvm/llvm_ocaml.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/llvm/bindings/ocaml/llvm/llvm.ml b/llvm/bindings/ocaml/llvm/llvm.ml index 83b6b874bbc..7f34afcd177 100644 --- a/llvm/bindings/ocaml/llvm/llvm.ml +++ b/llvm/bindings/ocaml/llvm/llvm.ml @@ -469,6 +469,7 @@ external struct_element_types : lltype -> lltype array = "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 .....................--*) diff --git a/llvm/bindings/ocaml/llvm/llvm.mli b/llvm/bindings/ocaml/llvm/llvm.mli index 67a1c1aad14..3404dadeada 100644 --- a/llvm/bindings/ocaml/llvm/llvm.mli +++ b/llvm/bindings/ocaml/llvm/llvm.mli @@ -665,6 +665,10 @@ val is_packed : lltype -> bool [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} *) diff --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c index 9ebb48aa034..b2d27879c31 100644 --- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c +++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c @@ -510,6 +510,11 @@ CAMLprim value llvm_is_opaque(LLVMTypeRef StructTy) { 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 */ |

