diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-21 18:46:45 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-21 18:46:45 +0000 |
commit | e407c1d1583cfc788fa7d00fee5f612c3f224983 (patch) | |
tree | 9a435a96a85d310bef7c8debd3be7fd2db2db026 /lib/VMCore/Pass.cpp | |
parent | b1e51f6910d23b7383c44a4650092c14be791bf8 (diff) | |
download | llvm-e407c1d1583cfc788fa7d00fee5f612c3f224983.tar.gz llvm-e407c1d1583cfc788fa7d00fee5f612c3f224983.tar.bz2 llvm-e407c1d1583cfc788fa7d00fee5f612c3f224983.tar.xz |
Move several non-performance-critical member functinos out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index a60877db2f..efd98af0f4 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -35,6 +35,15 @@ using namespace llvm; // Pass Implementation // +Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} + +Pass::Pass(PassKind K, const void *pid) + : Resolver(0), PassID((intptr_t)pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} + // Force out-of-line virtual method. Pass::~Pass() { delete Resolver; @@ -92,6 +101,23 @@ void Pass::verifyAnalysis() const { // By default, don't do anything. } +void *Pass::getAdjustedAnalysisPointer(const PassInfo *) { + return this; +} + +ImmutablePass *Pass::getAsImmutablePass() { + return 0; +} + +PMDataManager *Pass::getAsPMDataManager() { + return 0; +} + +void Pass::setResolver(AnalysisResolver *AR) { + assert(!Resolver && "Resolver is already set"); + Resolver = AR; +} + // 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 // implement this method. @@ -364,6 +390,14 @@ void PassInfo::unregisterPass() { getPassRegistrar()->UnregisterPass(*this); } +Pass *PassInfo::createPass() const { + assert((!isAnalysisGroup() || NormalCtor) && + "No default implementation found for analysis group!"); + assert(NormalCtor && + "Cannot call createPass on PassInfo without default ctor!"); + return NormalCtor(); +} + //===----------------------------------------------------------------------===// // Analysis Group Implementation Code //===----------------------------------------------------------------------===// @@ -467,4 +501,15 @@ void AnalysisUsage::setPreservesCFG() { GetCFGOnlyPasses(Preserved).enumeratePasses(); } +AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); + Required.push_back(ID); + return *this; +} +AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); + Required.push_back(ID); + RequiredTransitive.push_back(ID); + return *this; +} |