r178153 - [analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
Anna Zaks
ganna at apple.com
Wed Mar 27 10:36:02 PDT 2013
Author: zaks
Date: Wed Mar 27 12:36:01 2013
New Revision: 178153
URL: http://llvm.org/viewvc/llvm-project?rev=178153&view=rev
Log:
[analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp?rev=178153&r1=178152&r2=178153&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp Wed Mar 27 12:36:01 2013
@@ -117,8 +117,7 @@ bool ExplodedGraph::shouldCollect(const
return false;
// Condition 4.
- PostStmt ps = progPoint.castAs<PostStmt>();
- if (ps.getTag())
+ if (progPoint.getTag())
return false;
// Conditions 5, 6, and 7.
@@ -128,8 +127,9 @@ bool ExplodedGraph::shouldCollect(const
progPoint.getLocationContext() != pred->getLocationContext())
return false;
- // All further checks require expressions.
- const Expr *Ex = dyn_cast<Expr>(ps.getStmt());
+ // All further checks require expressions. As per #3, we know that we have
+ // a PostStmt.
+ const Expr *Ex = dyn_cast<Expr>(progPoint.castAs<PostStmt>().getStmt());
if (!Ex)
return false;
More information about the cfe-commits
mailing list