Move getAnalysisToUpdate to after the definition of AnalysisResolver.
authorChris Lattner <sabre@nondot.org>
Fri, 29 Aug 2003 14:26:51 +0000 (14:26 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 29 Aug 2003 14:26:51 +0000 (14:26 +0000)
GCC 3.4 apparently wants classes to be DEFINED before they are USED.  What is
it smoking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8213 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Pass.h
include/llvm/PassAnalysisSupport.h

index a0fa060fbf962be98d4c4abbc48df609ec125ee1..9e43b5e0a3a99c5c2f7a82a1f03450c7c7098974 100644 (file)
@@ -136,12 +136,7 @@ public:
   /// 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
index 97588c3ae3499002f5ae3b82c2b35939318d7e5a..d27d66964979ccf9d099c5395f86c2b8d3adaa66 100644 (file)
@@ -110,4 +110,20 @@ protected:
   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