[cfe-commits] r64876 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Tue Feb 17 18:00:25 PST 2009


Author: kremenek
Date: Tue Feb 17 20:00:25 2009
New Revision: 64876

URL: http://llvm.org/viewvc/llvm-project?rev=64876&view=rev
Log:
retain/release checker: Record the summary used to generate a given node.

Modified:
    cfe/trunk/lib/Analysis/CFRefCount.cpp

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=64876&r1=64875&r2=64876&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Feb 17 20:00:25 2009
@@ -1284,6 +1284,7 @@
 
 private:
   RetainSummaryManager Summaries;  
+  llvm::DenseMap<const GRExprEngine::NodeTy*, const RetainSummary*> SummaryLog;
   const LangOptions&   LOpts;
 
   BugType *useAfterRelease, *releaseNotOwned;
@@ -1655,11 +1656,15 @@
     }
   }
   
-  // Is this a sink?
-  if (IsEndPath(Summ))
-    Builder.MakeSinkNode(Dst, Ex, Pred, state);
-  else
-    Builder.MakeNode(Dst, Ex, Pred, state);
+  // Generate a sink node if we are at the end of a path.
+  GRExprEngine::NodeTy *NewNode =
+    IsEndPath(Summ) ? Builder.MakeSinkNode(Dst, Ex, Pred, state)
+                    : Builder.MakeNode(Dst, Ex, Pred, state);
+  
+  // Annotate the edge with summary we used.
+  // FIXME: This assumes that we always use the same summary when generating
+  //  this node.
+  if (NewNode) SummaryLog[NewNode] = Summ;
 }
 
 





More information about the cfe-commits mailing list