[PATCH] D52205: [OCaml] Add OCaml API for LLVMIsCleanup

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 17 18:51:59 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL342438: [OCaml] Add OCaml API for LLVMIsCleanup (authored by whitequark, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D52205

Files:
  llvm/trunk/bindings/ocaml/llvm/llvm.ml
  llvm/trunk/bindings/ocaml/llvm/llvm.mli
  llvm/trunk/bindings/ocaml/llvm/llvm_ocaml.c


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
@@ -1914,6 +1914,11 @@
     return Val_unit;
 }
 
+/* llvalue -> bool */
+CAMLprim value llvm_is_cleanup(LLVMValueRef LandingPadInst)
+{
+    return Val_bool(LLVMIsCleanup(LandingPadInst));
+}
 
 /* llvalue -> bool -> unit */
 CAMLprim value llvm_set_cleanup(LLVMValueRef LandingPadInst, value flag)
Index: llvm/trunk/bindings/ocaml/llvm/llvm.ml
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.ml
+++ llvm/trunk/bindings/ocaml/llvm/llvm.ml
@@ -1187,6 +1187,7 @@
                       = "llvm_build_invoke_bc" "llvm_build_invoke_nat"
 external build_landingpad : lltype -> llvalue -> int -> string -> llbuilder ->
                             llvalue = "llvm_build_landingpad"
+external is_cleanup : llvalue -> bool = "llvm_is_cleanup"
 external set_cleanup : llvalue -> bool -> unit = "llvm_set_cleanup"
 external add_clause : llvalue -> llvalue -> unit = "llvm_add_clause"
 external build_resume : llvalue -> llbuilder -> llvalue = "llvm_build_resume"
Index: llvm/trunk/bindings/ocaml/llvm/llvm.mli
===================================================================
--- llvm/trunk/bindings/ocaml/llvm/llvm.mli
+++ llvm/trunk/bindings/ocaml/llvm/llvm.mli
@@ -2093,6 +2093,10 @@
 val build_landingpad : lltype -> llvalue -> int -> string -> llbuilder ->
                          llvalue
 
+(** [is_cleanup lp] returns [true] if [landingpad] instruction lp is a cleanup.
+    See the method [llvm::LandingPadInst::isCleanup]. *)
+val is_cleanup : llvalue -> bool
+
 (** [set_cleanup lp] sets the cleanup flag in the [landingpad]instruction.
     See the method [llvm::LandingPadInst::setCleanup]. *)
 val set_cleanup : llvalue -> bool -> unit


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52205.165885.patch
Type: text/x-patch
Size: 1919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/beb30d70/attachment.bin>


More information about the llvm-commits mailing list