diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 9 | ||||
-rw-r--r-- | include/llvm/Analysis/FindUsedTypes.h | 4 | ||||
-rw-r--r-- | include/llvm/Analysis/IntervalPartition.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/PostDominators.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 3 | ||||
-rw-r--r-- | include/llvm/Pass.h | 5 |
8 files changed, 36 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index ce305d5..8c1a3ed 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -300,6 +300,9 @@ public: // FIXME: Should remove this virtual bool runOnFunction(Function &F) { return false; } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual void releaseMemory() { reset(); } /// getNode - return the (Post)DominatorTree node for the specified basic @@ -691,6 +694,9 @@ public: return DT->getRootNode(); } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -910,6 +916,9 @@ public: return Roots[0]; } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual bool runOnFunction(Function &) { Frontiers.clear(); DominatorTree &DT = getAnalysis<DominatorTree>(); diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h index b0d38c5..605cc07 100644 --- a/include/llvm/Analysis/FindUsedTypes.h +++ b/include/llvm/Analysis/FindUsedTypes.h @@ -50,6 +50,10 @@ private: void IncorporateValue(const Value *V); public: + + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + /// run - This incorporates all types used by the specified module bool runOnModule(Module &M); diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h index 8b85e7c..855e3a4 100644 --- a/include/llvm/Analysis/IntervalPartition.h +++ b/include/llvm/Analysis/IntervalPartition.h @@ -49,6 +49,9 @@ public: IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 29781b2..afefbf1 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -580,6 +580,9 @@ public: LoopInfoBase() { } ~LoopInfoBase() { releaseMemory(); } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + void releaseMemory() { for (typename std::vector<LoopBase<BlockT>* >::iterator I = TopLevelLoops.begin(), E = TopLevelLoops.end(); I != E; ++I) diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index c6ef41f..d16295b 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -68,6 +68,9 @@ class MemoryDependenceAnalysis : public FunctionPass { static char ID; // Class identification, replacement for typeinfo MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {} + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + /// Pass Implementation stuff. This doesn't do any analysis. /// bool runOnFunction(Function &) {return false; } diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h index 07910e9..c55022b 100644 --- a/include/llvm/Analysis/PostDominators.h +++ b/include/llvm/Analysis/PostDominators.h @@ -29,6 +29,9 @@ struct PostDominatorTree : public FunctionPass { DT = new DominatorTreeBase<BasicBlock>(true); } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -69,6 +72,9 @@ struct PostDominanceFrontier : public DominanceFrontierBase { PostDominanceFrontier() : DominanceFrontierBase((intptr_t) &ID, true) {} + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual bool runOnFunction(Function &) { Frontiers.clear(); PostDominatorTree &DT = getAnalysis<PostDominatorTree>(); diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 4d9d5e5..d97abe4 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -291,6 +291,9 @@ namespace llvm { /// that no dangling references are left around. void deleteValueFromRecords(Value *V) const; + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { return true; } + virtual bool runOnFunction(Function &F); virtual void releaseMemory(); virtual void getAnalysisUsage(AnalysisUsage &AU) const; diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 5948922..58bdfc0 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -130,6 +130,11 @@ public: return Resolver; } + /// isAnalysis - Return true if this pass is implementing an analysis pass. + virtual bool isAnalysis() const { + return false; + } + /// getAnalysisUsage - This function should be overriden by passes that need /// analysis information to do their job. If a pass specifies that it uses a /// particular analysis result to this function, it can then use the |