aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-10-04 23:29:16 +0000
committerAnna Zaks <ganna@apple.com>2011-10-04 23:29:16 +0000
commitcbb7add8d7e3f868a6695a601e45fc13257bd9f5 (patch)
treee24c351562c397d036ac2fd5fcd2ade145e2fd07
parente089088b4ae51a1b7e1803739660c6039505dfee (diff)
[analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask CheckerContext to generate the nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141136 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h3
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp8
2 files changed, 4 insertions, 7 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 35c17906f6..417bea997e 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -121,8 +121,9 @@ public:
/// Allows checkers to generate a chain of nodes.
ExplodedNode *generateNode(const ProgramState *state,
ExplodedNode *pred,
+ const ProgramPointTag *tag = 0,
bool autoTransition = true) {
- ExplodedNode *N = generateNodeImpl(state, false, pred);
+ ExplodedNode *N = generateNodeImpl(state, false, pred, tag);
if (N && autoTransition)
addTransition(N);
return N;
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 2ff8291258..b31c4a732d 100644
--- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -3173,12 +3173,10 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
if (hasError) {
// Generate an error node.
state = state->set<RefBindings>(Sym, X);
- StmtNodeBuilder &Builder = C.getNodeBuilder();
static SimpleProgramPointTag
ReturnOwnLeakTag("RetainCountChecker : ReturnsOwnLeak");
- ExplodedNode *N = Builder.generateNode(S, state, Pred,
- &ReturnOwnLeakTag);
+ ExplodedNode *N = C.generateNode(state, Pred, &ReturnOwnLeakTag);
if (N) {
const LangOptions &LOpts = C.getASTContext().getLangOptions();
bool GCEnabled = C.isObjCGCEnabled();
@@ -3195,12 +3193,10 @@ void RetainCountChecker::checkReturnWithRetEffect(const ReturnStmt *S,
// Trying to return a not owned object to a caller expecting an
// owned object.
state = state->set<RefBindings>(Sym, X ^ RefVal::ErrorReturnedNotOwned);
- StmtNodeBuilder &Builder = C.getNodeBuilder();
static SimpleProgramPointTag
ReturnNotOwnedTag("RetainCountChecker : ReturnNotOwnedForOwned");
- ExplodedNode *N = Builder.generateNode(S, state, Pred,
- &ReturnNotOwnedTag);
+ ExplodedNode *N = C.generateNode(state, Pred, &ReturnNotOwnedTag);
if (N) {
if (!returnNotOwnedForOwned)
returnNotOwnedForOwned.reset(new ReturnedNotOwnedForOwned());