source: parabix-LLVM/llvm_git/bindings/ocaml/transforms/ipo/ipo_ocaml.c @ 4078

Last change on this file since 4078 was 4078, checked in by linmengl, 5 years ago

checkin llvm-meng source

File size: 3.8 KB
Line 
1/*===-- ipo_ocaml.c - LLVM OCaml Glue ---------------------------*- C++ -*-===*\
2|*                                                                            *|
3|*                     The LLVM Compiler Infrastructure                       *|
4|*                                                                            *|
5|* This file is distributed under the University of Illinois Open Source      *|
6|* License. See LICENSE.TXT for details.                                      *|
7|*                                                                            *|
8|*===----------------------------------------------------------------------===*|
9|*                                                                            *|
10|* This file glues LLVM's OCaml interface to its C interface. These functions *|
11|* are by and large transparent wrappers to the corresponding C functions.    *|
12|*                                                                            *|
13|* Note that these functions intentionally take liberties with the CAMLparamX *|
14|* macros, since most of the parameters are not GC heap objects.              *|
15|*                                                                            *|
16\*===----------------------------------------------------------------------===*/
17
18#include "llvm-c/Transforms/IPO.h"
19#include "caml/mlvalues.h"
20#include "caml/misc.h"
21
22/* [`Module] Llvm.PassManager.t -> unit */
23CAMLprim value llvm_add_argument_promotion(LLVMPassManagerRef PM) {
24  LLVMAddArgumentPromotionPass(PM);
25  return Val_unit;
26}
27
28/* [`Module] Llvm.PassManager.t -> unit */
29CAMLprim value llvm_add_constant_merge(LLVMPassManagerRef PM) {
30  LLVMAddConstantMergePass(PM);
31  return Val_unit;
32}
33
34/* [`Module] Llvm.PassManager.t -> unit */
35CAMLprim value llvm_add_dead_arg_elimination(LLVMPassManagerRef PM) {
36  LLVMAddDeadArgEliminationPass(PM);
37  return Val_unit;
38}
39
40/* [`Module] Llvm.PassManager.t -> unit */
41CAMLprim value llvm_add_function_attrs(LLVMPassManagerRef PM) {
42  LLVMAddFunctionAttrsPass(PM);
43  return Val_unit;
44}
45
46/* [`Module] Llvm.PassManager.t -> unit */
47CAMLprim value llvm_add_function_inlining(LLVMPassManagerRef PM) {
48  LLVMAddFunctionInliningPass(PM);
49  return Val_unit;
50}
51
52/* [`Module] Llvm.PassManager.t -> unit */
53CAMLprim value llvm_add_always_inliner(LLVMPassManagerRef PM) {
54  LLVMAddAlwaysInlinerPass(PM);
55  return Val_unit;
56}
57
58/* [`Module] Llvm.PassManager.t -> unit */
59CAMLprim value llvm_add_always_inliner_pass(LLVMPassManagerRef PM) {
60  LLVMAddAlwaysInlinerPass(PM);
61  return Val_unit;
62}
63
64/* [`Module] Llvm.PassManager.t -> unit */
65CAMLprim value llvm_add_global_dce(LLVMPassManagerRef PM) {
66  LLVMAddGlobalDCEPass(PM);
67  return Val_unit;
68}
69
70/* [`Module] Llvm.PassManager.t -> unit */
71CAMLprim value llvm_add_global_optimizer(LLVMPassManagerRef PM) {
72  LLVMAddGlobalOptimizerPass(PM);
73  return Val_unit;
74}
75
76/* [`Module] Llvm.PassManager.t -> unit */
77CAMLprim value llvm_add_ipc_propagation(LLVMPassManagerRef PM) {
78  LLVMAddIPConstantPropagationPass(PM);
79  return Val_unit;
80}
81
82/* [`Module] Llvm.PassManager.t -> unit */
83CAMLprim value llvm_add_prune_eh(LLVMPassManagerRef PM) {
84  LLVMAddPruneEHPass(PM);
85  return Val_unit;
86}
87
88/* [`Module] Llvm.PassManager.t -> unit */
89CAMLprim value llvm_add_ipsccp(LLVMPassManagerRef PM) {
90  LLVMAddIPSCCPPass(PM);
91  return Val_unit;
92}
93
94/* [`Module] Llvm.PassManager.t -> bool -> unit */
95CAMLprim value llvm_add_internalize(LLVMPassManagerRef PM, value AllButMain) {
96  LLVMAddInternalizePass(PM, Bool_val(AllButMain));
97  return Val_unit;
98}
99
100/* [`Module] Llvm.PassManager.t -> unit */
101CAMLprim value llvm_add_strip_dead_prototypes(LLVMPassManagerRef PM) {
102  LLVMAddStripDeadPrototypesPass(PM);
103  return Val_unit;
104}
105
106/* [`Module] Llvm.PassManager.t -> unit */
107CAMLprim value llvm_add_strip_symbols(LLVMPassManagerRef PM) {
108  LLVMAddStripSymbolsPass(PM);
109  return Val_unit;
110}
Note: See TracBrowser for help on using the repository browser.