]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove recursive visitation in ExprEngine::VisitCastExpr because it isn...
authorTed Kremenek <kremenek@apple.com>
Fri, 29 Jul 2011 21:18:37 +0000 (21:18 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 29 Jul 2011 21:18:37 +0000 (21:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136520 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 6c1a8e8dd842dd7eeb63e08f3351c39625e2664c..3c4c078eb0ddd2ad0f91e8a9fa7446cce78af906 100644 (file)
@@ -2019,14 +2019,13 @@ void ExprEngine::VisitObjCMessage(const ObjCMessage &msg,
 void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, 
                            ExplodedNode *Pred, ExplodedNodeSet &Dst) {
   
-  ExplodedNodeSet S1;
-  Visit(Ex, Pred, S1);
-  ExplodedNodeSet S2;
-  getCheckerManager().runCheckersForPreStmt(S2, S1, CastE, *this);
+  ExplodedNodeSet dstPreStmt;
+  getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this);
   
   if (CastE->getCastKind() == CK_LValueToRValue ||
       CastE->getCastKind() == CK_GetObjCProperty) {
-    for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I!=E; ++I) {
+    for (ExplodedNodeSet::iterator I = dstPreStmt.begin(), E = dstPreStmt.end();
+         I!=E; ++I) {
       ExplodedNode *subExprNode = *I;
       const GRState *state = GetState(subExprNode);
       evalLoad(Dst, CastE, subExprNode, state, state->getSVal(Ex));
@@ -2041,7 +2040,9 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex,
   if (const ExplicitCastExpr *ExCast=dyn_cast_or_null<ExplicitCastExpr>(CastE))
     T = ExCast->getTypeAsWritten();
 
-  for (ExplodedNodeSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) {
+  for (ExplodedNodeSet::iterator I = dstPreStmt.begin(), E = dstPreStmt.end();
+       I != E; ++I) {
+
     Pred = *I;
 
     switch (CastE->getCastKind()) {