[llvm-commits] [llvm] r72731 - /llvm/trunk/include/llvm/PassAnalysisSupport.h

Devang Patel dpatel at apple.com
Tue Jun 2 10:26:30 PDT 2009


Author: dpatel
Date: Tue Jun  2 12:26:29 2009
New Revision: 72731

URL: http://llvm.org/viewvc/llvm-project?rev=72731&view=rev
Log:
Simplify assertion message to avoid confusion.

Modified:
    llvm/trunk/include/llvm/PassAnalysisSupport.h

Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=72731&r1=72730&r2=72731&view=diff

==============================================================================
--- llvm/trunk/include/llvm/PassAnalysisSupport.h (original)
+++ llvm/trunk/include/llvm/PassAnalysisSupport.h Tue Jun  2 12:26:29 2009
@@ -226,23 +226,21 @@
 template<typename AnalysisType>
 AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) {
   assert(PI && "getAnalysis for unregistered pass!");
-   assert(Resolver&&"Pass has not been inserted into a PassManager object!");
-   // PI *must* appear in AnalysisImpls.  Because the number of passes used
-   // should be a small number, we just do a linear search over a (dense)
-   // vector.
-   Pass *ResultPass = Resolver->findImplPass(this, PI, F);
-   assert (ResultPass && 
-           "getAnalysis*() called on an analysis that was not "
-           "'required' by pass!");
- 
-   // Because the AnalysisType may not be a subclass of pass (for
-   // AnalysisGroups), we must use dynamic_cast here to potentially adjust the
-   // return pointer (because the class may multiply inherit, once from pass,
-   // once from AnalysisType).
-   //
-   AnalysisType *Result = dynamic_cast<AnalysisType*>(ResultPass);
-   assert(Result && "Pass does not implement interface required!");
-   return *Result;
+  assert(Resolver && "Pass has not been inserted into a PassManager object!");
+  // PI *must* appear in AnalysisImpls.  Because the number of passes used
+  // should be a small number, we just do a linear search over a (dense)
+  // vector.
+  Pass *ResultPass = Resolver->findImplPass(this, PI, F);
+  assert (ResultPass &&  "Unable to find requested analysis info");
+  
+  // Because the AnalysisType may not be a subclass of pass (for
+  // AnalysisGroups), we must use dynamic_cast here to potentially adjust the
+  // return pointer (because the class may multiply inherit, once from pass,
+  // once from AnalysisType).
+  //
+  AnalysisType *Result = dynamic_cast<AnalysisType*>(ResultPass);
+  assert(Result && "Pass does not implement interface required!");
+  return *Result;
 }
 
 } // End llvm namespace





More information about the llvm-commits mailing list