[llvm-commits] CVS: llvm/include/llvm/PassAnalysisSupport.h Pass.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 29 09:28:03 PDT 2003
Changes in directory llvm/include/llvm:
PassAnalysisSupport.h updated: 1.13 -> 1.14
Pass.h updated: 1.37 -> 1.38
---
Log message:
Move getAnalysisToUpdate to after the definition of AnalysisResolver.
GCC 3.4 apparently wants classes to be DEFINED before they are USED. What is
it smoking.
---
Diffs of the changes:
Index: llvm/include/llvm/PassAnalysisSupport.h
diff -u llvm/include/llvm/PassAnalysisSupport.h:1.13 llvm/include/llvm/PassAnalysisSupport.h:1.14
--- llvm/include/llvm/PassAnalysisSupport.h:1.13 Sat Jun 21 22:07:32 2003
+++ llvm/include/llvm/PassAnalysisSupport.h Fri Aug 29 09:26:51 2003
@@ -110,4 +110,20 @@
void setAnalysisResolver(Pass *P, AnalysisResolver *AR);
};
+/// 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 *Pass::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));
+}
+
#endif
Index: llvm/include/llvm/Pass.h
diff -u llvm/include/llvm/Pass.h:1.37 llvm/include/llvm/Pass.h:1.38
--- llvm/include/llvm/Pass.h:1.37 Mon Aug 18 09:27:03 2003
+++ llvm/include/llvm/Pass.h Fri Aug 29 09:26:51 2003
@@ -136,12 +136,7 @@
/// 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));
- }
+ AnalysisType *getAnalysisToUpdate() const; // Defined in PassAnalysisSupport.h
/// mustPreserveAnalysisID - This method serves the same function as
/// getAnalysisToUpdate, but works if you just have an AnalysisID. This
More information about the llvm-commits
mailing list