]> granicus.if.org Git - clang/commitdiff
Remove recursive visitation in ExprEngine for UO_Deref, UO_AddrOf, and UO_Extension.
authorTed Kremenek <kremenek@apple.com>
Tue, 14 Feb 2012 21:27:05 +0000 (21:27 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 14 Feb 2012 21:27:05 +0000 (21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150506 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineC.cpp

index 03529b17ded96e0ecdb34a1a93780b6ab4fa8e5f..f9625735213d856dbfc690c96ebefe94dc3cb3fe 100644 (file)
@@ -606,23 +606,18 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U,
     case UO_Deref:
     case UO_AddrOf:
     case UO_Extension: {
-      
+      // FIXME: We can probably just have some magic in Environment::getSVal()
+      // that propagates values, instead of creating a new node here.
+      //
       // Unary "+" is a no-op, similar to a parentheses.  We still have places
       // where it may be a block-level expression, so we need to
       // generate an extra node that just propagates the value of the
-      // subexpression.
-      
+      // subexpression.      
       const Expr *Ex = U->getSubExpr()->IgnoreParens();
-      ExplodedNodeSet Tmp;
-      Visit(Ex, Pred, Tmp);
-      
-      for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
-        ProgramStateRef state = (*I)->getState();
-        const LocationContext *LCtx = (*I)->getLocationContext();
-        Bldr.generateNode(U, *I, state->BindExpr(U, LCtx,
+      ProgramStateRef state = Pred->getState();
+      const LocationContext *LCtx = Pred->getLocationContext();
+      Bldr.generateNode(U, Pred, state->BindExpr(U, LCtx,
                                                  state->getSVal(Ex, LCtx)));
-      }
-      
       break;
     }