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
This commit is contained in:
Brian Gaeke 2003-08-13 18:18:15 +00:00
parent fb0ef2e82c
commit 19df3876e6
16 changed files with 25 additions and 24 deletions

View File

@ -17,15 +17,15 @@
class Function;
class TargetMachine;
class Pass;
class FunctionPass;
class SSARegMap;
class MachineFunctionInfo;
class MachineFrameInfo;
class MachineConstantPool;
Pass *createMachineCodeConstructionPass(TargetMachine &TM);
Pass *createMachineCodeDestructionPass();
Pass *createMachineFunctionPrinterPass();
FunctionPass *createMachineCodeConstructionPass(TargetMachine &TM);
FunctionPass *createMachineCodeDestructionPass();
FunctionPass *createMachineFunctionPrinterPass();
class MachineFunction : private Annotation {
const Function *Fn;

View File

@ -8,7 +8,7 @@
#ifndef LLVM_CODEGEN_PASSES_H
#define LLVM_CODEGEN_PASSES_H
class Pass;
class FunctionPass;
class PassInfo;
// PHIElimination pass - This pass eliminates machine instruction PHI nodes by
@ -22,17 +22,17 @@ extern const PassInfo *PHIEliminationID;
/// from SSA form to use explicit registers by spilling every register. Wow,
/// great policy huh?
///
Pass *createSimpleRegisterAllocator();
FunctionPass *createSimpleRegisterAllocator();
/// LocalRegisterAllocation Pass - This pass register allocates the input code a
/// basic block at a time, yielding code better than the simple register
/// allocator, but not as good as a global allocator.
///
Pass *createLocalRegisterAllocator();
FunctionPass *createLocalRegisterAllocator();
/// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
/// and eliminates abstract frame references.
///
Pass *createPrologEpilogCodeInserter();
FunctionPass *createPrologEpilogCodeInserter();
#endif

View File

@ -9,6 +9,7 @@
#define LLVM_TRANSFORMS_SCALAR_H
class Pass;
class FunctionPass;
class GetElementPtrInst;
class PassInfo;
class TerminatorInst;
@ -244,7 +245,7 @@ Pass *createRaiseAllocationsPass();
// This pass converts SwitchInst instructions into a sequence of chained binary
// branch instructions.
//
Pass *createLowerSwitchPass();
FunctionPass *createLowerSwitchPass();
//===----------------------------------------------------------------------===//
//

View File

@ -80,15 +80,15 @@ namespace {
};
}
Pass *createMachineCodeConstructionPass(TargetMachine &Target) {
FunctionPass *createMachineCodeConstructionPass(TargetMachine &Target) {
return new ConstructMachineFunction(Target);
}
Pass *createMachineCodeDestructionPass() {
FunctionPass *createMachineCodeDestructionPass() {
return new DestroyMachineFunction();
}
Pass *createMachineFunctionPrinterPass() {
FunctionPass *createMachineFunctionPrinterPass() {
return new Printer();
}

View File

@ -62,7 +62,7 @@ namespace {
/// createPrologEpilogCodeInserter - This function returns a pass that inserts
/// prolog and epilog code, and eliminates abstract frame references.
///
Pass *createPrologEpilogCodeInserter() { return new PEI(); }
FunctionPass *createPrologEpilogCodeInserter() { return new PEI(); }
/// saveCallerSavedRegisters - Scan the function for modified caller saved

View File

@ -643,6 +643,6 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) {
return true;
}
Pass *createLocalRegisterAllocator() {
FunctionPass *createLocalRegisterAllocator() {
return new RA();
}

View File

@ -224,6 +224,6 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
return true;
}
Pass *createSimpleRegisterAllocator() {
FunctionPass *createSimpleRegisterAllocator() {
return new RegAllocSimple();
}

View File

@ -117,7 +117,7 @@ namespace {
};
}
Pass *createX86FloatingPointStackifierPass() { return new FPS(); }
FunctionPass *createX86FloatingPointStackifierPass() { return new FPS(); }
/// runOnMachineFunction - Loop over all of the basic blocks, transforming FP
/// register references into FP stack references.

View File

@ -112,6 +112,6 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
/// into a machine code representation using pattern matching and a machine
/// description file.
///
Pass *createX86PatternInstructionSelector(TargetMachine &TM) {
FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}

View File

@ -2105,6 +2105,6 @@ void ISel::visitFreeInst(FreeInst &I) {
/// into a machine code representation is a very simple peep-hole fashion. The
/// generated code sucks but the implementation is nice and simple.
///
Pass *createX86SimpleInstructionSelector(TargetMachine &TM) {
FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}

View File

@ -19,7 +19,7 @@ namespace {
};
}
Pass *createX86PeepholeOptimizerPass() { return new PH(); }
FunctionPass *createX86PeepholeOptimizerPass() { return new PH(); }
bool PH::runOnMachineFunction(MachineFunction &MF) {
bool Changed = false;

View File

@ -117,7 +117,7 @@ namespace {
};
}
Pass *createX86FloatingPointStackifierPass() { return new FPS(); }
FunctionPass *createX86FloatingPointStackifierPass() { return new FPS(); }
/// runOnMachineFunction - Loop over all of the basic blocks, transforming FP
/// register references into FP stack references.

View File

@ -112,6 +112,6 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
/// into a machine code representation using pattern matching and a machine
/// description file.
///
Pass *createX86PatternInstructionSelector(TargetMachine &TM) {
FunctionPass *createX86PatternInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}

View File

@ -2105,6 +2105,6 @@ void ISel::visitFreeInst(FreeInst &I) {
/// into a machine code representation is a very simple peep-hole fashion. The
/// generated code sucks but the implementation is nice and simple.
///
Pass *createX86SimpleInstructionSelector(TargetMachine &TM) {
FunctionPass *createX86SimpleInstructionSelector(TargetMachine &TM) {
return new ISel(TM);
}

View File

@ -19,7 +19,7 @@ namespace {
};
}
Pass *createX86PeepholeOptimizerPass() { return new PH(); }
FunctionPass *createX86PeepholeOptimizerPass() { return new PH(); }
bool PH::runOnMachineFunction(MachineFunction &MF) {
bool Changed = false;

View File

@ -30,7 +30,7 @@ namespace {
}
// createLowerSwitchPass - Interface to this file...
Pass *createLowerSwitchPass() {
FunctionPass *createLowerSwitchPass() {
return new LowerSwitch();
}