aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h24
-rw-r--r--lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp2
2 files changed, 8 insertions, 18 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index cdd72880a4..db9c6c5ca2 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -107,6 +107,8 @@ public:
return Eng.isObjCGCEnabled();
}
+ /// \brief Generate a default checker node (containing checker tag but no
+ /// checker state changes).
ExplodedNode *generateNode(bool autoTransition = true) {
assert(statement && "Only transitions with statements currently supported");
ExplodedNode *N = generateNodeImpl(statement, getState(), false,
@@ -116,18 +118,8 @@ public:
return N;
}
- ExplodedNode *generateNode(const Stmt *stmt,
- const ProgramState *state,
- bool autoTransition = true,
- const ProgramPointTag *tag = 0) {
- assert(state);
- ExplodedNode *N = generateNodeImpl(stmt, state, false,
- tag ? tag : checkerTag);
- if (N && autoTransition)
- addTransition(N);
- return N;
- }
-
+ /// \brief Generate a new checker node with the given predecessor.
+ /// Allows checkers to generate a chain of nodes.
ExplodedNode *generateNode(const ProgramState *state,
ExplodedNode *pred,
bool autoTransition = true) {
@@ -138,6 +130,7 @@ public:
return N;
}
+ /// \brief Generate a new checker node.
ExplodedNode *generateNode(const ProgramState *state,
bool autoTransition = true,
const ProgramPointTag *tag = 0) {
@@ -149,11 +142,8 @@ public:
return N;
}
- ExplodedNode *generateSink(const Stmt *stmt, const ProgramState *state = 0) {
- return generateNodeImpl(stmt, state ? state : getState(), true,
- checkerTag);
- }
-
+ /// \brief Generate a sink node. Generating sink stops exploration of the
+ /// given path.
ExplodedNode *generateSink(const ProgramState *state = 0) {
assert(statement && "Only transitions with statements currently supported");
return generateNodeImpl(statement, state ? state : getState(), true,
diff --git a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
index 2602fac833..81f1924b2c 100644
--- a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
@@ -77,7 +77,7 @@ void NoReturnFunctionChecker::checkPostStmt(const CallExpr *CE,
}
if (BuildSinks)
- C.generateSink(CE);
+ C.generateSink();
}
static bool END_WITH_NULL isMultiArgSelector(const Selector *Sel, ...) {