From cbb7add8d7e3f868a6695a601e45fc13257bd9f5 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Tue, 4 Oct 2011 23:29:16 +0000 Subject: [PATCH] [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 --- .../StaticAnalyzer/Core/PathSensitive/CheckerContext.h | 3 ++- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 8 ++------ 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(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(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()); -- 2.50.1