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 | 078d9cf1ce4d96dbe032668cdcec8bb923e1c399 (patch) | |
tree | da6bcbef7edfc062060abf44ddab6d96f1150d40 | |
parent | 86f6afb2fcf72c987aa2cfc01f5b4044dda349bd (diff) | |
download | external_llvm-078d9cf1ce4d96dbe032668cdcec8bb923e1c399.zip external_llvm-078d9cf1ce4d96dbe032668cdcec8bb923e1c399.tar.gz external_llvm-078d9cf1ce4d96dbe032668cdcec8bb923e1c399.tar.bz2 |
Simplify assertion message to avoid confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72731 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/PassAnalysisSupport.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index de37862..b09ba45 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/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 |