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