aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-18 02:00:25 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-18 02:00:25 +0000
commitf5b34b120ed8f1601009acb98292e4337295cf57 (patch)
tree1f77824abdc8734d619bf121916d2e3f8188cf51 /lib/Analysis/CFRefCount.cpp
parent47099742e22c84a4dc905a01ad4180a3fd4fa99f (diff)
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
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp15
1 files 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<const GRExprEngine::NodeTy*, const RetainSummary*> SummaryLog;
const LangOptions& LOpts;
BugType *useAfterRelease, *releaseNotOwned;
@@ -1655,11 +1656,15 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& 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;
}