aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-12-06 18:58:29 +0000
committerJordan Rose <jordan_rose@apple.com>2012-12-06 18:58:29 +0000
commitc39f9fa39c472a6663111788b89c67fd365271d8 (patch)
treeb2c84a43dd18436f7e13fd3d7ae978bfe42ec6a9 /lib/StaticAnalyzer/Core/ExplodedGraph.cpp
parent9428723d6730f4fd257e15b78d24991ae95bbd84 (diff)
[analyzer] Remove isa<> followed by dyn_cast<>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/ExplodedGraph.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
index 3c5380c54d..d64078f750 100644
--- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -104,14 +104,13 @@ bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
// Do not collect nodes for non-consumed Stmt or Expr to ensure precise
// diagnostic generation; specifically, so that we could anchor arrows
// pointing to the beginning of statements (as written in code).
- if (!isa<Expr>(ps.getStmt()))
+ const Expr *Ex = dyn_cast<Expr>(ps.getStmt());
+ if (!Ex)
+ return false;
+
+ ParentMap &PM = progPoint.getLocationContext()->getParentMap();
+ if (!PM.isConsumedExpr(Ex))
return false;
-
- if (const Expr *Ex = dyn_cast<Expr>(ps.getStmt())) {
- ParentMap &PM = progPoint.getLocationContext()->getParentMap();
- if (!PM.isConsumedExpr(Ex))
- return false;
- }
// Condition 9.
const ProgramPoint SuccLoc = succ->getLocation();