Extend the ProgramPoint to include the context information LocationContext,
which is either a stack frame context of the function or a local scope
context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79072 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 02f427a..683be27 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -181,7 +181,8 @@
ExplodedNode *MakeNode(const GRState *state, ExplodedNode *Pred) {
if (SNB)
- return SNB->generateNode(PostStmt(S, tag), state, Pred);
+ return SNB->generateNode(PostStmt(S, Pred->getLocationContext(), tag),
+ state, Pred);
assert(ENB);
return ENB->generateNode(state, Pred);
@@ -3203,7 +3204,8 @@
static int ReturnOwnLeakTag = 0;
state = state->set<RefBindings>(Sym, X);
ExplodedNode *N =
- Builder.generateNode(PostStmt(S, &ReturnOwnLeakTag), state, Pred);
+ Builder.generateNode(PostStmt(S, Pred->getLocationContext(),
+ &ReturnOwnLeakTag), state, Pred);
if (N) {
CFRefReport *report =
new CFRefLeakReport(*static_cast<CFRefBug*>(leakAtReturn), *this,
@@ -3224,8 +3226,9 @@
static int ReturnNotOwnedForOwnedTag = 0;
state = state->set<RefBindings>(Sym, X ^ RefVal::ErrorReturnedNotOwned);
if (ExplodedNode *N =
- Builder.generateNode(PostStmt(S, &ReturnNotOwnedForOwnedTag),
- state, Pred)) {
+ Builder.generateNode(PostStmt(S, Pred->getLocationContext(),
+ &ReturnNotOwnedForOwnedTag),
+ state, Pred)) {
CFRefReport *report =
new CFRefReport(*static_cast<CFRefBug*>(returnNotOwnedForOwned),
*this, N, Sym);