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

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 3c4c078eb0ddd2ad0f91e8a9fa7446cce78af906..82312d871d95764f482c4c871f94fd70cc763f6c 100644 (file)
@@ -2146,21 +2146,18 @@ void ExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr* CL,
                                             ExplodedNodeSet& Dst) {
   const InitListExpr* ILE 
     = cast<InitListExpr>(CL->getInitializer()->IgnoreParens());
-  ExplodedNodeSet Tmp;
-  Visit(ILE, Pred, Tmp);
+  
+  const GRState* state = GetState(Pred);
+  SVal ILV = state->getSVal(ILE);
 
-  for (ExplodedNodeSet::iterator I = Tmp.begin(), EI = Tmp.end(); I!=EI; ++I) {
-    const GRState* state = GetState(*I);
-    SVal ILV = state->getSVal(ILE);
-    const LocationContext *LC = (*I)->getLocationContext();
-    state = state->bindCompoundLiteral(CL, LC, ILV);
+  const LocationContext *LC = Pred->getLocationContext();
+  state = state->bindCompoundLiteral(CL, LC, ILV);
 
-    if (CL->isLValue()) {
-      MakeNode(Dst, CL, *I, state->BindExpr(CL, state->getLValue(CL, LC)));
-    }
-    else
-      MakeNode(Dst, CL, *I, state->BindExpr(CL, ILV));
+  if (CL->isLValue()) {
+    MakeNode(Dst, CL, Pred, state->BindExpr(CL, state->getLValue(CL, LC)));
   }
+  else
+    MakeNode(Dst, CL, Pred, state->BindExpr(CL, ILV));
 }
 
 void ExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,