diff options
author | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-29 23:48:34 +0000 |
---|---|---|
committer | Tom Care <tom.care@uqconnect.edu.au> | 2010-09-29 23:48:34 +0000 |
commit | 2f0419e1f86f55b5513d30e4a01b5fc93185a57f (patch) | |
tree | 988f53194722b0ca5e9fd1ea700ea0a865ff3ce6 | |
parent | a5f13c866cb5982251b5833033bbbc7307674ae7 (diff) | |
download | bcm5719-llvm-2f0419e1f86f55b5513d30e4a01b5fc93185a57f.tar.gz bcm5719-llvm-2f0419e1f86f55b5513d30e4a01b5fc93185a57f.zip |
AnalyzerStatsChecker improvements:
- Use BlockEntrance rather than BlockEdge to bring in line with UnreachableCodeChecker. Fixes an issue where unreached blocks would still be counted as reachable.
- Added warnings for all BlockAborted locations. This allows us to see where the analyzer stopped analyzing.
llvm-svn: 115110
-rw-r--r-- | clang/lib/Checker/AnalyzerStatsChecker.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/clang/lib/Checker/AnalyzerStatsChecker.cpp b/clang/lib/Checker/AnalyzerStatsChecker.cpp index b016eb9db0c..9badb79625d 100644 --- a/clang/lib/Checker/AnalyzerStatsChecker.cpp +++ b/clang/lib/Checker/AnalyzerStatsChecker.cpp @@ -54,8 +54,8 @@ void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G, if (!LC) LC = P.getLocationContext(); - if (const BlockEdge *BE = dyn_cast<BlockEdge>(&P)) { - const CFGBlock *CB = BE->getDst(); + if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&P)) { + const CFGBlock *CB = BE->getBlock(); reachable.insert(CB); } } @@ -101,4 +101,17 @@ void AnalyzerStatsChecker::VisitEndAnalysis(ExplodedGraph &G, B.EmitBasicReport("Analyzer Statistics", "Internal Statistics", output.str(), D->getLocation()); + + // Emit warning for each block we bailed out on + typedef GRCoreEngine::BlocksAborted::const_iterator AbortedIterator; + const GRCoreEngine &CE = Eng.getCoreEngine(); + for (AbortedIterator I = CE.blocks_aborted_begin(), + E = CE.blocks_aborted_end(); I != E; ++I) { + const BlockEdge &BE = I->first; + const CFGBlock *Exit = BE.getDst(); + const CFGElement &CE = Exit->front(); + if (const CFGStmt *CS = dyn_cast<CFGStmt>(&CE)) + B.EmitBasicReport("Bailout Point", "Internal Statistics", "The analyzer " + "stopped analyzing at this point", CS->getStmt()->getLocStart()); + } } |