summaryrefslogtreecommitdiffstats
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
commit8569d2d8f2f0b9e98f56e9b150de1cd03db77e1f (patch)
treefd3367ed86df76f3a6f1c5bef6f741065de756f2
parent0ca562ec4c8422938535ea8512c58444a50a07d8 (diff)
downloadbcm5719-llvm-8569d2d8f2f0b9e98f56e9b150de1cd03db77e1f.tar.gz
bcm5719-llvm-8569d2d8f2f0b9e98f56e9b150de1cd03db77e1f.zip
[analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask CheckerContext to generate the nodes.
llvm-svn: 141136
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h3
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp8
2 files changed, 4 insertions, 7 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 35c17906f68..417bea997e2 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/clang/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/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index 2ff82912588..b31c4a732dc 100644
--- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud