llvm.org GIT mirror llvm / 19df387
Factory methods for FunctionPasses now return type FunctionPass *. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8 Brian Gaeke 17 years ago
16 changed file(s) with 25 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
1616
1717 class Function;
1818 class TargetMachine;
19 class Pass;
19 class FunctionPass;
2020 class SSARegMap;
2121 class MachineFunctionInfo;
2222 class MachineFrameInfo;
2323 class MachineConstantPool;
2424
25 Pass *createMachineCodeConstructionPass(TargetMachine &TM);
26 Pass *createMachineCodeDestructionPass();
27 Pass *createMachineFunctionPrinterPass();
25 FunctionPass *createMachineCodeConstructionPass(TargetMachine &TM);
26 FunctionPass *createMachineCodeDestructionPass();
27 FunctionPass *createMachineFunctionPrinterPass();
2828
2929 class MachineFunction : private Annotation {
3030 const Function *Fn;
77 #ifndef LLVM_CODEGEN_PASSES_H
88 #define LLVM_CODEGEN_PASSES_H
99
10 class Pass;
10 class FunctionPass;
1111 class PassInfo;
1212
1313 // PHIElimination pass - This pass eliminates machine instruction PHI nodes by
2121 /// from SSA form to use explicit registers by spilling every register. Wow,
2222 /// great policy huh?
2323 ///
24 Pass *createSimpleRegisterAllocator();
24 FunctionPass *createSimpleRegisterAllocator();
2525
2626 /// LocalRegisterAllocation Pass - This pass register allocates the input code a
2727 /// basic block at a time, yielding code better than the simple register
2828 /// allocator, but not as good as a global allocator.
2929 ///
30 Pass *createLocalRegisterAllocator();
30 FunctionPass *createLocalRegisterAllocator();
3131
3232 /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
3333 /// and eliminates abstract frame references.
3434 ///
35 Pass *createPrologEpilogCodeInserter();
35 FunctionPass *createPrologEpilogCodeInserter();
3636
3737 #endif
88 #define LLVM_TRANSFORMS_SCALAR_H
99
1010 class Pass;
11 class FunctionPass;
1112 class GetElementPtrInst;
1213 class PassInfo;
1314 class TerminatorInst;
243244 // This pass converts SwitchInst instructions into a sequence of chained binary
244245 // branch instructions.
245246 //
246 Pass *createLowerSwitchPass();
247 FunctionPass *createLowerSwitchPass();
247248
248249 //===----------------------------------------------------------------------===//
249250 //
7979 };
8080 }
8181
82 Pass *createMachineCodeConstructionPass(TargetMachine &Target) {
82 FunctionPass *createMachineCodeConstructionPass(TargetMachine &Target) {
8383 return new ConstructMachineFunction(Target);
8484 }
8585
86 Pass *createMachineCodeDestructionPass() {
86 FunctionPass *createMachineCodeDestructionPass() {
8787 return new DestroyMachineFunction();
8888 }
8989
90 Pass *createMachineFunctionPrinterPass() {
90 FunctionPass *createMachineFunctionPrinterPass() {
9191 return new Printer();
9292 }
9393
6161 /// createPrologEpilogCodeInserter - This function returns a pass that inserts
6262 /// prolog and epilog code, and eliminates abstract frame references.
6363 ///
64 Pass *createPrologEpilogCodeInserter() { return new PEI(); }
64 FunctionPass *createPrologEpilogCodeInserter() { return new PEI(); }
6565
6666
6767 /// saveCallerSavedRegisters - Scan the function for modified caller saved
642642 return true;
643643 }
644644
645 Pass *createLocalRegisterAllocator() {
645 FunctionPass *createLocalRegisterAllocator() {
646646 return new RA();
647647 }
223223 return true;
224224 }
225225
226 Pass *createSimpleRegisterAllocator() {
226 FunctionPass *createSimpleRegisterAllocator() {
227227 return new RegAllocSimple();
228228 }
116116 };
117117 }
118118
119 Pass *createX86FloatingPointStackifierPass() { return new FPS(); }
119 FunctionPass *createX86FloatingPointStackifierPass() { return new FPS(); }
120120
121121 /// runOnMachineFunction - Loop over all of the basic blocks, transforming FP
122122 /// register references into FP stack references.
111111 /// into a machine code representation using pattern matching and a machine
112112 /// description file.
113113 ///
114 Pass *createX86PatternInstructionSelector(TargetMachine &TM) {
114 FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
115115 return new ISel(TM);
116116 }
21042104 /// into a machine code representation is a very simple peep-hole fashion. The
21052105 /// generated code sucks but the implementation is nice and simple.
21062106 ///
2107 Pass *createX86SimpleInstructionSelector(TargetMachine &TM) {
2107 FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
21082108 return new ISel(TM);
21092109 }
1818 };
1919 }
2020
21 Pass *createX86PeepholeOptimizerPass() { return new PH(); }
21 FunctionPass *createX86PeepholeOptimizerPass() { return new PH(); }
2222
2323 bool PH::runOnMachineFunction(MachineFunction &MF) {
2424 bool Changed = false;
116116 };
117117 }
118118
119 Pass *createX86FloatingPointStackifierPass() { return new FPS(); }
119 FunctionPass *createX86FloatingPointStackifierPass() { return new FPS(); }
120120
121121 /// runOnMachineFunction - Loop over all of the basic blocks, transforming FP
122122 /// register references into FP stack references.
111111 /// into a machine code representation using pattern matching and a machine
112112 /// description file.
113113 ///
114 Pass *createX86PatternInstructionSelector(TargetMachine &TM) {
114 FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
115115 return new ISel(TM);
116116 }
21042104 /// into a machine code representation is a very simple peep-hole fashion. The
21052105 /// generated code sucks but the implementation is nice and simple.
21062106 ///
2107 Pass *createX86SimpleInstructionSelector(TargetMachine &TM) {
2107 FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
21082108 return new ISel(TM);
21092109 }
1818 };
1919 }
2020
21 Pass *createX86PeepholeOptimizerPass() { return new PH(); }
21 FunctionPass *createX86PeepholeOptimizerPass() { return new PH(); }
2222
2323 bool PH::runOnMachineFunction(MachineFunction &MF) {
2424 bool Changed = false;
2929 }
3030
3131 // createLowerSwitchPass - Interface to this file...
32 Pass *createLowerSwitchPass() {
32 FunctionPass *createLowerSwitchPass() {
3333 return new LowerSwitch();
3434 }
3535