From: Anna Zaks Date: Tue, 4 Oct 2011 18:34:40 +0000 (+0000) Subject: [analyzer] Remove unused methods, add comments to others. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ba721428af297e540fb40b176eeeea0ee010c1f;p=clang [analyzer] Remove unused methods, add comments to others. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141098 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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, ...) {