Simplify assertion message to avoid confusion.
authorDevang Patel <dpatel@apple.com>
Tue, 2 Jun 2009 17:26:29 +0000 (17:26 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 2 Jun 2009 17:26:29 +0000 (17:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72731 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/PassAnalysisSupport.h

index de37862b62983932c931245c7f5973debfd92950..b09ba45e346d3b9bdfdc44925f273ce4414fa3cc 100644 (file)
@@ -226,23 +226,21 @@ AnalysisType &Pass::getAnalysis(Function &F) {
 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