]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove isa<> followed by dyn_cast<>.
authorJordan Rose <jordan_rose@apple.com>
Thu, 6 Dec 2012 18:58:29 +0000 (18:58 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 6 Dec 2012 18:58:29 +0000 (18:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169530 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExplodedGraph.cpp

index 3c5380c54d2e2335fa94f35a7c8b02294e6c1624..d64078f750dd01dccfb97ee4e9ce394684611910 100644 (file)
@@ -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();