diff options
author | Torok Edwin <edwintorok@gmail.com> | 2011-10-03 06:41:46 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2011-10-03 06:41:46 +0000 |
commit | 48488a64fadb2f99706029e51ae4c06fcfac5cdb (patch) | |
tree | c60f5c57a1d50b22acfb0336a3d2663a499bd39f /bindings/ocaml | |
parent | 4fcc80a486300021d320aec8cd125022ef701e5b (diff) | |
download | external_llvm-48488a64fadb2f99706029e51ae4c06fcfac5cdb.zip external_llvm-48488a64fadb2f99706029e51ae4c06fcfac5cdb.tar.gz external_llvm-48488a64fadb2f99706029e51ae4c06fcfac5cdb.tar.bz2 |
attempt to fix ocaml bindings: landing pads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml')
-rw-r--r-- | bindings/ocaml/llvm/llvm.ml | 3 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm.mli | 12 | ||||
-rw-r--r-- | bindings/ocaml/llvm/llvm_ocaml.c | 13 |
3 files changed, 27 insertions, 1 deletions
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index 7786d8c..e335eb8 100644 --- a/bindings/ocaml/llvm/llvm.ml +++ b/bindings/ocaml/llvm/llvm.ml @@ -820,6 +820,9 @@ external add_destination : llvalue -> llbasicblock -> unit external build_invoke : llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string -> llbuilder -> llvalue = "llvm_build_invoke_bc" "llvm_build_invoke_nat" +external build_landingpad : lltype -> llvalue -> int -> string -> llbuilder -> + llvalue = "llvm_build_landingpad" +external set_cleanup : llvalue -> bool -> unit = "llvm_set_cleanup" external build_unreachable : llbuilder -> llvalue = "llvm_build_unreachable" (*--... Arithmetic .........................................................--*) diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli index 2462148..ef7c986 100644 --- a/bindings/ocaml/llvm/llvm.mli +++ b/bindings/ocaml/llvm/llvm.mli @@ -339,7 +339,7 @@ val ppc_fp128_type : llcontext -> lltype See the method [llvm::FunctionType::get]. *) val function_type : lltype -> lltype array -> lltype -(** [va_arg_function_type ret_ty param_tys] is just like +(** [var_arg_function_type ret_ty param_tys] is just like [function_type ret_ty param_tys] except that it returns the function type which also takes a variable number of arguments. See the method [llvm::FunctionType::get]. *) @@ -1615,6 +1615,16 @@ val add_destination : llvalue -> llbasicblock -> unit val build_invoke : llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string -> llbuilder -> llvalue +(** [build_landingpad ty persfn numclauses name b] creates an + [landingpad] + instruction at the position specified by the instruction builder [b]. + See the method [llvm::LLVMBuilder::CreateLandingPad]. *) +val build_landingpad : lltype -> llvalue -> int -> string -> llbuilder -> + llvalue + +(** [set_cleanup lp] sets the cleanup flag in the [landingpad]instruction. + See the method [llvm::LandingPadInst::setCleanup]. *) +val set_cleanup : llvalue -> bool -> unit (** [build_unreachable b] creates an [unreachable] diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 4baf99b..1c1a526 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -1212,6 +1212,19 @@ CAMLprim LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) { Args[4], Args[5]); } +CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn, + value NumClauses, value Name, + value B) { + return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses), + String_val(Name)); +} + +CAMLprim value llvm_set_cleanup(LLVMValueRef LandingPadInst, value flag) +{ + LLVMSetCleanup(LandingPadInst, Bool_val(flag)); + return Val_unit; +} + /* llbuilder -> llvalue */ CAMLprim LLVMValueRef llvm_build_unreachable(value B) { return LLVMBuildUnreachable(Builder_val(B)); |