Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
[OCaml] Add missing instruction opcodes to OCaml API
Browse files Browse the repository at this point in the history
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
  • Loading branch information
whitequark committed Sep 18, 2018
1 parent 3aa932d commit 915d439
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bindings/ocaml/llvm/llvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ module Opcode = struct
| AtomicRMW
| Resume
| LandingPad
| AddrSpaceCast
| CleanupRet
| CatchRet
| CatchPad
| CleanupPad
| CatchSwitch
end

module LandingPadClauseTy = struct
Expand Down
6 changes: 6 additions & 0 deletions bindings/ocaml/llvm/llvm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bindings/ocaml/llvm/llvm_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 915d439

Please sign in to comment.