aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassAnalysisSupport.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-06-02 17:26:29 +0000
committerDevang Patel <dpatel@apple.com>2009-06-02 17:26:29 +0000
commit8900bcc1ff60d2ce2ec55700c74814de7a603164 (patch)
treeda6bcbef7edfc062060abf44ddab6d96f1150d40 /include/llvm/PassAnalysisSupport.h
parentf41538d1b54f55e8900394929b50f7ce3e61125f (diff)
downloadexternal_llvm-8900bcc1ff60d2ce2ec55700c74814de7a603164.zip
external_llvm-8900bcc1ff60d2ce2ec55700c74814de7a603164.tar.gz
external_llvm-8900bcc1ff60d2ce2ec55700c74814de7a603164.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
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r--include/llvm/PassAnalysisSupport.h32
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