[analyzer] Cleanup: only get the PostStmt when we need the underlying Stmt + comment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178153 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
index ca466d8..af9518a 100644
--- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -117,8 +117,7 @@
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 @@
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;