From 915d43992f8fc501cf807eaf18566b7362f8e1cc Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 18 Sep 2018 00:00:53 +0000 Subject: [PATCH] [OCaml] Add missing instruction opcodes to OCaml API Summary: The OCaml bindings have become out of date and several opcodes have been added to the C API without corresponding additions to the OCaml API. Reviewers: whitequark, mgorny Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52196 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342427 91177308-0d34-0410-b5e6-96231b3b80d8 --- bindings/ocaml/llvm/llvm.ml | 6 ++++++ bindings/ocaml/llvm/llvm.mli | 6 ++++++ bindings/ocaml/llvm/llvm_ocaml.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml index 59f0f178c28..0a8a40a0d64 100644 --- a/bindings/ocaml/llvm/llvm.ml +++ b/bindings/ocaml/llvm/llvm.ml @@ -238,6 +238,12 @@ module Opcode = struct | AtomicRMW | Resume | LandingPad + | AddrSpaceCast + | CleanupRet + | CatchRet + | CatchPad + | CleanupPad + | CatchSwitch end module LandingPadClauseTy = struct diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli index b91d059e3b1..8d5cdb269ca 100644 --- a/bindings/ocaml/llvm/llvm.mli +++ b/bindings/ocaml/llvm/llvm.mli @@ -260,6 +260,12 @@ module Opcode : sig | AtomicRMW | Resume | LandingPad + | AddrSpaceCast + | CleanupRet + | CatchRet + | CatchPad + | CleanupPad + | CatchSwitch end (** The type of a clause of a [landingpad] instruction. diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 77689edcf6d..28f9b264f0c 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -1515,7 +1515,7 @@ CAMLprim value llvm_instr_get_opcode(LLVMValueRef Inst) { if (!LLVMIsAInstruction(Inst)) failwith("Not an instruction"); o = LLVMGetInstructionOpcode(Inst); - assert (o <= LLVMLandingPad); + assert (o <= LLVMCatchSwitch); return Val_int(o); }