summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-06 02:14:47 +0000
committerChris Lattner <sabre@nondot.org>2002-09-06 02:14:47 +0000
commitc0396b8b9e3db16dc65ed7a2491edd1ab45f91a1 (patch)
tree7049afe708b027c03d8e939195b31b0dac7f2a98
parent8a97c8ab10e913fc31e94170db1739ae3b5d025e (diff)
downloadbcm5719-llvm-c0396b8b9e3db16dc65ed7a2491edd1ab45f91a1.tar.gz
bcm5719-llvm-c0396b8b9e3db16dc65ed7a2491edd1ab45f91a1.zip
Make getAnalysisToUpdate<AnalysisType>() public so that transformation APIs
can update analysis information. llvm-svn: 3584
-rw-r--r--llvm/include/llvm/Pass.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/llvm/include/llvm/Pass.h b/llvm/include/llvm/Pass.h
index 6f5f8d63b46..cdd00300183 100644
--- a/llvm/include/llvm/Pass.h
+++ b/llvm/include/llvm/Pass.h
@@ -125,6 +125,22 @@ public:
// or null if it is not known.
static const PassInfo *lookupPassInfo(const std::type_info &TI);
+ /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
+ /// to get to the analysis information that might be around that needs to be
+ /// updated. This is different than getAnalysis in that it can fail (ie the
+ /// analysis results haven't been computed), so should only be used if you
+ /// provide the capability to update an analysis that exists. This method is
+ /// often used by transformation APIs to update analysis results for a pass
+ /// automatically as the transform is performed.
+ ///
+ template<typename AnalysisType>
+ AnalysisType *getAnalysisToUpdate() const {
+ assert(Resolver && "Pass not resident in a PassManager object!");
+ const PassInfo *PI = getClassPassInfo<AnalysisType>();
+ if (PI == 0) return 0;
+ return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
+ }
+
protected:
/// getAnalysis<AnalysisType>() - This function is used by subclasses to get
@@ -167,21 +183,6 @@ protected:
return *Result;
}
- /// getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses
- /// to get to the analysis information that might be around that needs to be
- /// updated. This is different than getAnalysis in that it can fail (ie the
- /// analysis results haven't been computed), so should only be used if you
- /// provide the capability to update an analysis that exists.
- ///
- template<typename AnalysisType>
- AnalysisType *getAnalysisToUpdate() const {
- assert(Resolver && "Pass not resident in a PassManager object!");
- const PassInfo *PI = getClassPassInfo<AnalysisType>();
- if (PI == 0) return 0;
- return dynamic_cast<AnalysisType*>(Resolver->getAnalysisToUpdate(PI));
- }
-
-
private:
friend class PassManagerT<Module>;
friend class PassManagerT<Function>;
OpenPOWER on IntegriCloud