diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-23 00:29:34 +0000 |
commit | 00be69ab5c21ad965959376a4b1cdeaaf13be443 (patch) | |
tree | e37dabd45c984fa9ab4e9ce859301092f133deda /clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp | |
parent | 16c8cf0e11dd7f53d3a50609d5821f56e6b52c1a (diff) | |
download | bcm5719-llvm-00be69ab5c21ad965959376a4b1cdeaaf13be443.tar.gz bcm5719-llvm-00be69ab5c21ad965959376a4b1cdeaaf13be443.zip |
Remove the CFGElement "Invalid" state.
Use Optional<CFG*> where invalid states were needed previously. In the one case
where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
CFGAutomaticObjDtor.
Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
and Doug Gregor.
Post commit code review feedback on r175796 by Ted Kremenek.
llvm-svn: 175938
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp index 217d467e034..9af0a5ac4fd 100644 --- a/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp @@ -123,14 +123,14 @@ void AnalyzerStatsChecker::checkEndAnalysis(ExplodedGraph &G, const BlockEdge &BE = I->first; const CFGBlock *Exit = BE.getDst(); const CFGElement &CE = Exit->front(); - if (CFGStmt CS = CE.getAs<CFGStmt>()) { + if (Optional<CFGStmt> CS = CE.getAs<CFGStmt>()) { SmallString<128> bufI; llvm::raw_svector_ostream outputI(bufI); outputI << "(" << NameOfRootFunction << ")" << ": The analyzer generated a sink at this point"; - B.EmitBasicReport(D, "Sink Point", "Internal Statistics", outputI.str(), - PathDiagnosticLocation::createBegin(CS.getStmt(), - SM, LC)); + B.EmitBasicReport( + D, "Sink Point", "Internal Statistics", outputI.str(), + PathDiagnosticLocation::createBegin(CS->getStmt(), SM, LC)); } } } |