mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-03 00:33:09 +00:00
patch #4 in Saem's passmanager refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25077 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
60e9187a90
commit
53745b852d
@ -620,6 +620,7 @@ public:
|
||||
// Initialize the immutable pass...
|
||||
IP->initializePass();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -659,7 +660,10 @@ public:
|
||||
virtual const char *getPMName() const { return "BasicBlock"; }
|
||||
|
||||
virtual const char *getPassName() const { return "BasicBlock Pass Manager"; }
|
||||
|
||||
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB);
|
||||
|
||||
|
||||
// TODO:Start absorbing PassManagerTraits<BasicBlock>
|
||||
};
|
||||
|
||||
@ -682,7 +686,12 @@ public:
|
||||
// Implement the BasicBlockPass interface...
|
||||
virtual bool doInitialization(Module &M);
|
||||
virtual bool doInitialization(Function &F);
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB);
|
||||
|
||||
// Forwarded
|
||||
virtual bool runOnBasicBlock(BasicBlock &BB) {
|
||||
return BasicBlockPassManager::runOnBasicBlock(BB);
|
||||
}
|
||||
|
||||
virtual bool doFinalization(Function &F);
|
||||
virtual bool doFinalization(Module &M);
|
||||
|
||||
@ -728,7 +737,10 @@ public:
|
||||
virtual const char *getPMName() const { return "Function"; }
|
||||
|
||||
virtual const char *getPassName() const { return "Function Pass Manager"; }
|
||||
|
||||
|
||||
virtual bool runOnFunction(Function &F);
|
||||
|
||||
|
||||
// TODO:Start absorbing PassManagerTraits<Function>
|
||||
};
|
||||
|
||||
@ -749,7 +761,12 @@ public:
|
||||
|
||||
// Implement the FunctionPass interface...
|
||||
virtual bool doInitialization(Module &M);
|
||||
virtual bool runOnFunction(Function &F);
|
||||
|
||||
// Forwarded
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
return FunctionPassManagerT::runOnFunction(F);
|
||||
}
|
||||
|
||||
virtual bool doFinalization(Module &M);
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
@ -762,7 +779,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ModulePassManager
|
||||
//
|
||||
@ -792,6 +808,8 @@ public:
|
||||
// debugging.
|
||||
virtual const char *getPMName() const { return "Module"; }
|
||||
|
||||
// runOnModule - Implement the PassManager interface.
|
||||
virtual bool runOnModule(Module &M);
|
||||
|
||||
// TODO:Start absorbing PassManagerTraits<Module>
|
||||
};
|
||||
@ -808,9 +826,9 @@ public:
|
||||
// runPass - Specify how the pass should be run on the UnitType
|
||||
static bool runPass(PassClass *P, Module *M) { return P->runOnModule(*M); }
|
||||
|
||||
// runOnModule - Implement the PassManager interface.
|
||||
// Forwarded
|
||||
bool runOnModule(Module &M) {
|
||||
return ((PassManagerT<Module>*)this)->runOnUnit(&M);
|
||||
return ModulePassManager::runOnModule(M);
|
||||
}
|
||||
|
||||
// Forwarded
|
||||
@ -820,6 +838,31 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// PassManagerTraits Method Implementations
|
||||
//
|
||||
|
||||
// BasicBlockPassManager Implementations
|
||||
//
|
||||
|
||||
inline bool BasicBlockPassManager::runOnBasicBlock(BasicBlock &BB) {
|
||||
return ((PMType*)this)->runOnUnit(&BB);
|
||||
}
|
||||
|
||||
// FunctionPassManagerT Implementations
|
||||
//
|
||||
|
||||
inline bool FunctionPassManagerT::runOnFunction(Function &F) {
|
||||
return ((PMType*)this)->runOnUnit(&F);
|
||||
}
|
||||
|
||||
// ModulePassManager Implementations
|
||||
//
|
||||
|
||||
bool ModulePassManager::runOnModule(Module &M) {
|
||||
return ((PassManagerT<Module>*)this)->runOnUnit(&M);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// PassManagerTraits Method Implementations
|
||||
//
|
||||
@ -840,10 +883,6 @@ inline bool PassManagerTraits<BasicBlock>::doInitialization(Function &F) {
|
||||
return Changed;
|
||||
}
|
||||
|
||||
inline bool PassManagerTraits<BasicBlock>::runOnBasicBlock(BasicBlock &BB) {
|
||||
return ((PMType*)this)->runOnUnit(&BB);
|
||||
}
|
||||
|
||||
inline bool PassManagerTraits<BasicBlock>::doFinalization(Function &F) {
|
||||
bool Changed = false;
|
||||
for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
|
||||
@ -868,10 +907,6 @@ inline bool PassManagerTraits<Function>::doInitialization(Module &M) {
|
||||
return Changed;
|
||||
}
|
||||
|
||||
inline bool PassManagerTraits<Function>::runOnFunction(Function &F) {
|
||||
return ((PMType*)this)->runOnUnit(&F);
|
||||
}
|
||||
|
||||
inline bool PassManagerTraits<Function>::doFinalization(Module &M) {
|
||||
bool Changed = false;
|
||||
for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user