Add prototype for the lowersetjmp pass
[oota-llvm.git] / include / llvm / Transforms / IPO.h
1 //===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- C++ -*-===//
2 //
3 // This header file defines prototypes for accessor functions that expose passes
4 // in the IPO transformations library.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_TRANSFORMS_IPO_H
9 #define LLVM_TRANSFORMS_IPO_H
10
11 class Pass;
12 class Function;
13
14 //===----------------------------------------------------------------------===//
15 // createLowerSetJmpPass - This function lowers the setjmp/longjmp intrinsics to
16 // invoke/unwind instructions.  This should really be part of the C/C++
17 // front-end, but it's so much easier to write transformations in LLVM proper.
18 //
19 Pass* createLowerSetJmpPass();
20
21 //===----------------------------------------------------------------------===//
22 // createConstantMergePass - This function returns a new pass that merges
23 // duplicate global constants together into a single constant that is shared.
24 // This is useful because some passes (ie TraceValues) insert a lot of string
25 // constants into the program, regardless of whether or not they duplicate an
26 // existing string.
27 //
28 Pass *createConstantMergePass();
29
30
31 //===----------------------------------------------------------------------===//
32 // createRaiseAllocationsPass - Return a new pass that transforms malloc and
33 // free function calls into malloc and free instructions.
34 //
35 Pass *createRaiseAllocationsPass();
36
37
38 //===----------------------------------------------------------------------===//
39 // createDeadTypeEliminationPass - Return a new pass that eliminates symbol
40 // table entries for types that are never used.
41 //
42 Pass *createDeadTypeEliminationPass();
43
44
45 //===----------------------------------------------------------------------===//
46 // createGlobalDCEPass - This transform is designed to eliminate unreachable
47 // internal globals (functions or global variables)
48 //
49 Pass *createGlobalDCEPass();
50
51
52 //===----------------------------------------------------------------------===//
53 // createFunctionExtractionPass - This pass deletes as much of the module as
54 // possible, except for the function specified.
55 //
56 Pass *createFunctionExtractionPass(Function *F);
57
58
59 //===----------------------------------------------------------------------===//
60 // FunctionResolvingPass - Go over the functions that are in the module and
61 // look for functions that have the same name.  More often than not, there will
62 // be things like:
63 //    void "foo"(...)
64 //    void "foo"(int, int)
65 // because of the way things are declared in C.  If this is the case, patch
66 // things up.
67 //
68 // This is an interprocedural pass.
69 //
70 Pass *createFunctionResolvingPass();
71
72 //===----------------------------------------------------------------------===//
73 // createFunctionInliningPass - Return a new pass object that uses a heuristic
74 // to inline direct function calls to small functions.
75 //
76 Pass *createFunctionInliningPass();
77
78 //===----------------------------------------------------------------------===//
79 // createPruneEHPass - Return a new pass object which transforms invoke
80 // instructions into calls, if the callee can _not_ unwind the stack.
81 //
82 Pass *createPruneEHPass();
83
84 //===----------------------------------------------------------------------===//
85 // createInternalizePass - This pass loops over all of the functions in the
86 // input module, looking for a main function.  If a main function is found, all
87 // other functions are marked as internal.
88 //
89 Pass *createInternalizePass();
90
91 //===----------------------------------------------------------------------===//
92 // createDeadArgEliminationPass - This pass removes arguments from functions
93 // which are not used by the body of the function.  If
94 // DeleteFromExternalFunctions is true, the pass will modify functions that have
95 // external linkage, which is not usually safe (this is used by bugpoint to
96 // reduce testcases).
97 //
98 Pass *createDeadArgEliminationPass(bool DeleteFromExternalFunctions=false);
99
100
101 //===----------------------------------------------------------------------===//
102 // These passes are wrappers that can do a few simple structure mutation
103 // transformations.
104 //
105 Pass *createSwapElementsPass();
106 Pass *createSortElementsPass();
107
108 #endif