From f5b34b120ed8f1601009acb98292e4337295cf57 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 18 Feb 2009 02:00:25 +0000 Subject: [PATCH] retain/release checker: Record the summary used to generate a given node. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64876 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/CFRefCount.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 81faf21653..8fea99b4f6 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1284,6 +1284,7 @@ public: private: RetainSummaryManager Summaries; + llvm::DenseMap SummaryLog; const LangOptions& LOpts; BugType *useAfterRelease, *releaseNotOwned; @@ -1655,11 +1656,15 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst, } } - // 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; } -- 2.50.1