summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-03-27 17:36:01 +0000
committerAnna Zaks <ganna@apple.com>2013-03-27 17:36:01 +0000
commit54417f6d68e60a9e65d243927036ff80bef46767 (patch)
treef74613890d15c1d49603d739ca282ea260374e72 /clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
parent22fa6ecc14edfec1644a6f771aba8081af628f1b (diff)
downloadbcm5719-llvm-54417f6d68e60a9e65d243927036ff80bef46767.tar.gz
bcm5719-llvm-54417f6d68e60a9e65d243927036ff80bef46767.zip
[analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
llvm-svn: 178153
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
index ca466d89070..af9518acc79 100644
--- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -117,8 +117,7 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
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 ExplodedNode *node) {
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;
OpenPOWER on IntegriCloud