diff options
| author | Devang Patel <dpatel@apple.com> | 2009-06-02 17:26:29 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-06-02 17:26:29 +0000 |
| commit | 9643e4f98519149ae8ea4987405b102a1a51a860 (patch) | |
| tree | 578b866862226fbb10fd681577738f19828d6de1 /llvm/include | |
| parent | fc968ef687ede038a0c1d130654429862a764217 (diff) | |
| download | bcm5719-llvm-9643e4f98519149ae8ea4987405b102a1a51a860.tar.gz bcm5719-llvm-9643e4f98519149ae8ea4987405b102a1a51a860.zip | |
Simplify assertion message to avoid confusion.
llvm-svn: 72731
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/PassAnalysisSupport.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/llvm/include/llvm/PassAnalysisSupport.h b/llvm/include/llvm/PassAnalysisSupport.h index de37862b629..b09ba45e346 100644 --- a/llvm/include/llvm/PassAnalysisSupport.h +++ b/llvm/include/llvm/PassAnalysisSupport.h @@ -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 |

