mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Move several function bodies which are rarely inlined out of line.
llvm-svn: 91319
This commit is contained in:
parent
81c6d73285
commit
d16b19ff3e
@ -111,12 +111,10 @@ public:
|
|||||||
virtual void assignPassManager(PMStack &,
|
virtual void assignPassManager(PMStack &,
|
||||||
PassManagerType = PMT_Unknown) {}
|
PassManagerType = PMT_Unknown) {}
|
||||||
/// Check if available pass managers are suitable for this pass or not.
|
/// Check if available pass managers are suitable for this pass or not.
|
||||||
virtual void preparePassManager(PMStack &) {}
|
virtual void preparePassManager(PMStack &);
|
||||||
|
|
||||||
/// Return what kind of Pass Manager can manage this pass.
|
/// Return what kind of Pass Manager can manage this pass.
|
||||||
virtual PassManagerType getPotentialPassManagerType() const {
|
virtual PassManagerType getPotentialPassManagerType() const;
|
||||||
return PMT_Unknown;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Access AnalysisResolver
|
// Access AnalysisResolver
|
||||||
inline void setResolver(AnalysisResolver *AR) {
|
inline void setResolver(AnalysisResolver *AR) {
|
||||||
@ -132,9 +130,7 @@ public:
|
|||||||
/// particular analysis result to this function, it can then use the
|
/// particular analysis result to this function, it can then use the
|
||||||
/// getAnalysis<AnalysisType>() function, below.
|
/// getAnalysis<AnalysisType>() function, below.
|
||||||
///
|
///
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &) const {
|
virtual void getAnalysisUsage(AnalysisUsage &) const;
|
||||||
// By default, no analysis results are used, all are invalidated.
|
|
||||||
}
|
|
||||||
|
|
||||||
/// releaseMemory() - This member can be implemented by a pass if it wants to
|
/// releaseMemory() - This member can be implemented by a pass if it wants to
|
||||||
/// be able to release its memory when it is no longer needed. The default
|
/// be able to release its memory when it is no longer needed. The default
|
||||||
@ -147,11 +143,11 @@ public:
|
|||||||
/// Optionally implement this function to release pass memory when it is no
|
/// Optionally implement this function to release pass memory when it is no
|
||||||
/// longer used.
|
/// longer used.
|
||||||
///
|
///
|
||||||
virtual void releaseMemory() {}
|
virtual void releaseMemory();
|
||||||
|
|
||||||
/// verifyAnalysis() - This member can be implemented by a analysis pass to
|
/// verifyAnalysis() - This member can be implemented by a analysis pass to
|
||||||
/// check state of analysis information.
|
/// check state of analysis information.
|
||||||
virtual void verifyAnalysis() const {}
|
virtual void verifyAnalysis() const;
|
||||||
|
|
||||||
// dumpPassStructure - Implement the -debug-passes=PassStructure option
|
// dumpPassStructure - Implement the -debug-passes=PassStructure option
|
||||||
virtual void dumpPassStructure(unsigned Offset = 0);
|
virtual void dumpPassStructure(unsigned Offset = 0);
|
||||||
@ -221,9 +217,7 @@ public:
|
|||||||
PassManagerType T = PMT_ModulePassManager);
|
PassManagerType T = PMT_ModulePassManager);
|
||||||
|
|
||||||
/// Return what kind of Pass Manager can manage this pass.
|
/// Return what kind of Pass Manager can manage this pass.
|
||||||
virtual PassManagerType getPotentialPassManagerType() const {
|
virtual PassManagerType getPotentialPassManagerType() const;
|
||||||
return PMT_ModulePassManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
explicit ModulePass(intptr_t pid) : Pass(pid) {}
|
explicit ModulePass(intptr_t pid) : Pass(pid) {}
|
||||||
explicit ModulePass(const void *pid) : Pass(pid) {}
|
explicit ModulePass(const void *pid) : Pass(pid) {}
|
||||||
@ -245,7 +239,7 @@ public:
|
|||||||
/// and if it does, the overloaded version of initializePass may get access to
|
/// and if it does, the overloaded version of initializePass may get access to
|
||||||
/// these passes with getAnalysis<>.
|
/// these passes with getAnalysis<>.
|
||||||
///
|
///
|
||||||
virtual void initializePass() {}
|
virtual void initializePass();
|
||||||
|
|
||||||
/// ImmutablePasses are never run.
|
/// ImmutablePasses are never run.
|
||||||
///
|
///
|
||||||
@ -276,7 +270,7 @@ public:
|
|||||||
/// doInitialization - Virtual method overridden by subclasses to do
|
/// doInitialization - Virtual method overridden by subclasses to do
|
||||||
/// any necessary per-module initialization.
|
/// any necessary per-module initialization.
|
||||||
///
|
///
|
||||||
virtual bool doInitialization(Module &) { return false; }
|
virtual bool doInitialization(Module &);
|
||||||
|
|
||||||
/// runOnFunction - Virtual method overriden by subclasses to do the
|
/// runOnFunction - Virtual method overriden by subclasses to do the
|
||||||
/// per-function processing of the pass.
|
/// per-function processing of the pass.
|
||||||
@ -286,7 +280,7 @@ public:
|
|||||||
/// doFinalization - Virtual method overriden by subclasses to do any post
|
/// doFinalization - Virtual method overriden by subclasses to do any post
|
||||||
/// processing needed after all passes have run.
|
/// processing needed after all passes have run.
|
||||||
///
|
///
|
||||||
virtual bool doFinalization(Module &) { return false; }
|
virtual bool doFinalization(Module &);
|
||||||
|
|
||||||
/// runOnModule - On a module, we run this pass by initializing,
|
/// runOnModule - On a module, we run this pass by initializing,
|
||||||
/// ronOnFunction'ing once for every function in the module, then by
|
/// ronOnFunction'ing once for every function in the module, then by
|
||||||
@ -303,9 +297,7 @@ public:
|
|||||||
PassManagerType T = PMT_FunctionPassManager);
|
PassManagerType T = PMT_FunctionPassManager);
|
||||||
|
|
||||||
/// Return what kind of Pass Manager can manage this pass.
|
/// Return what kind of Pass Manager can manage this pass.
|
||||||
virtual PassManagerType getPotentialPassManagerType() const {
|
virtual PassManagerType getPotentialPassManagerType() const;
|
||||||
return PMT_FunctionPassManager;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -328,12 +320,12 @@ public:
|
|||||||
/// doInitialization - Virtual method overridden by subclasses to do
|
/// doInitialization - Virtual method overridden by subclasses to do
|
||||||
/// any necessary per-module initialization.
|
/// any necessary per-module initialization.
|
||||||
///
|
///
|
||||||
virtual bool doInitialization(Module &) { return false; }
|
virtual bool doInitialization(Module &);
|
||||||
|
|
||||||
/// doInitialization - Virtual method overridden by BasicBlockPass subclasses
|
/// doInitialization - Virtual method overridden by BasicBlockPass subclasses
|
||||||
/// to do any necessary per-function initialization.
|
/// to do any necessary per-function initialization.
|
||||||
///
|
///
|
||||||
virtual bool doInitialization(Function &) { return false; }
|
virtual bool doInitialization(Function &);
|
||||||
|
|
||||||
/// runOnBasicBlock - Virtual method overriden by subclasses to do the
|
/// runOnBasicBlock - Virtual method overriden by subclasses to do the
|
||||||
/// per-basicblock processing of the pass.
|
/// per-basicblock processing of the pass.
|
||||||
@ -343,12 +335,12 @@ public:
|
|||||||
/// doFinalization - Virtual method overriden by BasicBlockPass subclasses to
|
/// doFinalization - Virtual method overriden by BasicBlockPass subclasses to
|
||||||
/// do any post processing needed after all passes have run.
|
/// do any post processing needed after all passes have run.
|
||||||
///
|
///
|
||||||
virtual bool doFinalization(Function &) { return false; }
|
virtual bool doFinalization(Function &);
|
||||||
|
|
||||||
/// doFinalization - Virtual method overriden by subclasses to do any post
|
/// doFinalization - Virtual method overriden by subclasses to do any post
|
||||||
/// processing needed after all passes have run.
|
/// processing needed after all passes have run.
|
||||||
///
|
///
|
||||||
virtual bool doFinalization(Module &) { return false; }
|
virtual bool doFinalization(Module &);
|
||||||
|
|
||||||
|
|
||||||
// To run this pass on a function, we simply call runOnBasicBlock once for
|
// To run this pass on a function, we simply call runOnBasicBlock once for
|
||||||
@ -360,9 +352,7 @@ public:
|
|||||||
PassManagerType T = PMT_BasicBlockPassManager);
|
PassManagerType T = PMT_BasicBlockPassManager);
|
||||||
|
|
||||||
/// Return what kind of Pass Manager can manage this pass.
|
/// Return what kind of Pass Manager can manage this pass.
|
||||||
virtual PassManagerType getPotentialPassManagerType() const {
|
virtual PassManagerType getPotentialPassManagerType() const;
|
||||||
return PMT_BasicBlockPassManager;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// If the user specifies the -time-passes argument on an LLVM tool command line
|
/// If the user specifies the -time-passes argument on an LLVM tool command line
|
||||||
|
@ -41,6 +41,10 @@ Pass::~Pass() {
|
|||||||
// Force out-of-line virtual method.
|
// Force out-of-line virtual method.
|
||||||
ModulePass::~ModulePass() { }
|
ModulePass::~ModulePass() { }
|
||||||
|
|
||||||
|
PassManagerType ModulePass::getPotentialPassManagerType() const {
|
||||||
|
return PMT_ModulePassManager;
|
||||||
|
}
|
||||||
|
|
||||||
bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
|
bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
|
||||||
return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0;
|
return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0;
|
||||||
}
|
}
|
||||||
@ -60,6 +64,27 @@ const char *Pass::getPassName() const {
|
|||||||
return "Unnamed pass: implement Pass::getPassName()";
|
return "Unnamed pass: implement Pass::getPassName()";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pass::preparePassManager(PMStack &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
}
|
||||||
|
|
||||||
|
PassManagerType Pass::getPotentialPassManagerType() const {
|
||||||
|
// Default implementation.
|
||||||
|
return PMT_Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pass::getAnalysisUsage(AnalysisUsage &) const {
|
||||||
|
// By default, no analysis results are used, all are invalidated.
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pass::releaseMemory() {
|
||||||
|
// By default, don't do anything.
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pass::verifyAnalysis() const {
|
||||||
|
// By default, don't do anything.
|
||||||
|
}
|
||||||
|
|
||||||
// print - Print out the internal state of the pass. This is called by Analyze
|
// print - Print out the internal state of the pass. This is called by Analyze
|
||||||
// to print out the contents of an analysis. Otherwise it is not necessary to
|
// to print out the contents of an analysis. Otherwise it is not necessary to
|
||||||
// implement this method.
|
// implement this method.
|
||||||
@ -79,6 +104,10 @@ void Pass::dump() const {
|
|||||||
// Force out-of-line virtual method.
|
// Force out-of-line virtual method.
|
||||||
ImmutablePass::~ImmutablePass() { }
|
ImmutablePass::~ImmutablePass() { }
|
||||||
|
|
||||||
|
void ImmutablePass::initializePass() {
|
||||||
|
// By default, don't do anything.
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// FunctionPass Implementation
|
// FunctionPass Implementation
|
||||||
//
|
//
|
||||||
@ -107,6 +136,20 @@ bool FunctionPass::run(Function &F) {
|
|||||||
return Changed | doFinalization(*F.getParent());
|
return Changed | doFinalization(*F.getParent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FunctionPass::doInitialization(Module &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FunctionPass::doFinalization(Module &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PassManagerType FunctionPass::getPotentialPassManagerType() const {
|
||||||
|
return PMT_FunctionPassManager;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// BasicBlockPass Implementation
|
// BasicBlockPass Implementation
|
||||||
//
|
//
|
||||||
@ -121,6 +164,30 @@ bool BasicBlockPass::runOnFunction(Function &F) {
|
|||||||
return Changed | doFinalization(F);
|
return Changed | doFinalization(F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BasicBlockPass::doInitialization(Module &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BasicBlockPass::doInitialization(Function &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BasicBlockPass::doFinalization(Function &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BasicBlockPass::doFinalization(Module &) {
|
||||||
|
// By default, don't do anything.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PassManagerType BasicBlockPass::getPotentialPassManagerType() const {
|
||||||
|
return PMT_BasicBlockPassManager;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Pass Registration mechanism
|
// Pass Registration mechanism
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user