diff options
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r-- | include/llvm/PassAnalysisSupport.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index c6ed179..f8b139e 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -143,8 +143,8 @@ public: AnalysisImpls.push_back(pir); } - // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist - Pass *getAnalysisToUpdate(AnalysisID ID, bool Direction) const; + // getAnalysisIfAvailable - Return analysis result or null if it doesn't exist + Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const; // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -157,22 +157,22 @@ private: PMDataManager &PM; }; -/// 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. +/// getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to +/// get analysis information that might be around, for example to update it. +/// This is different than getAnalysis in that it can fail (if the analysis +/// results haven't been computed), so should only be used if you can handle +/// the case when the analysis is not available. 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 *Pass::getAnalysisToUpdate() const { +AnalysisType *Pass::getAnalysisIfAvailable() 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, true)); + (Resolver->getAnalysisIfAvailable(PI, true)); } /// getAnalysis<AnalysisType>() - This function is used by subclasses to get |