[PATCH] OCaml bindings: Llvm_ipo: add missing transforms
Peter Zotov
whitequark at whitequark.org
Sat Oct 12 09:36:17 PDT 2013
Hi sylvestre.ledru,
This commit ensures that the OCaml bindings for IPO transforms are up-to-date with the C API.
http://llvm-reviews.chandlerc.com/D1918
Files:
bindings/ocaml/transforms/ipo/ipo_ocaml.c
bindings/ocaml/transforms/ipo/llvm_ipo.ml
bindings/ocaml/transforms/ipo/llvm_ipo.mli
test/Bindings/Ocaml/ipo_opts.ml
Index: bindings/ocaml/transforms/ipo/ipo_ocaml.c
===================================================================
--- bindings/ocaml/transforms/ipo/ipo_ocaml.c
+++ bindings/ocaml/transforms/ipo/ipo_ocaml.c
@@ -50,6 +50,12 @@
}
/* [`Module] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_always_inliner(LLVMPassManagerRef PM) {
+ LLVMAddAlwaysInlinerPass(PM);
+ return Val_unit;
+}
+
+/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_always_inliner_pass(LLVMPassManagerRef PM) {
LLVMAddAlwaysInlinerPass(PM);
return Val_unit;
Index: bindings/ocaml/transforms/ipo/llvm_ipo.ml
===================================================================
--- bindings/ocaml/transforms/ipo/llvm_ipo.ml
+++ bindings/ocaml/transforms/ipo/llvm_ipo.ml
@@ -17,6 +17,8 @@
"llvm_add_function_attrs"
external add_function_inlining : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_function_inlining"
+external add_always_inliner : [ | `Module ] Llvm.PassManager.t -> unit =
+ "llvm_add_always_inliner"
external add_global_dce : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_global_dce"
external add_global_optimizer : [ | `Module ] Llvm.PassManager.t -> unit =
Index: bindings/ocaml/transforms/ipo/llvm_ipo.mli
===================================================================
--- bindings/ocaml/transforms/ipo/llvm_ipo.mli
+++ bindings/ocaml/transforms/ipo/llvm_ipo.mli
@@ -32,6 +32,10 @@
external add_function_inlining : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_function_inlining"
+(** See llvm::createAlwaysInlinerPass function. *)
+external add_always_inliner : [ | `Module ] Llvm.PassManager.t -> unit =
+ "llvm_add_always_inliner"
+
(** See llvm::createGlobalDCEPass function. *)
external add_global_dce : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_global_dce"
Index: test/Bindings/Ocaml/ipo_opts.ml
===================================================================
--- test/Bindings/Ocaml/ipo_opts.ml
+++ test/Bindings/Ocaml/ipo_opts.ml
@@ -55,6 +55,7 @@
++ add_dead_arg_elimination
++ add_function_attrs
++ add_function_inlining
+ ++ add_always_inliner
++ add_global_dce
++ add_global_optimizer
++ add_ipc_propagation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1918.1.patch
Type: text/x-patch
Size: 2293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131012/c47bc216/attachment.bin>
More information about the llvm-commits
mailing list