diff options
Diffstat (limited to 'include/clang/StaticAnalyzer/Core')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/AnalyzerOptions.h | 14 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h | 6 |
2 files changed, 19 insertions, 1 deletions
diff --git a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h index ac30836561..fa0754acb1 100644 --- a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -187,6 +187,9 @@ private: /// \sa shouldPruneNullReturnPaths llvm::Optional<bool> PruneNullReturnPaths; + /// \sa shouldAvoidSuppressingNullArgumentPaths + llvm::Optional<bool> AvoidSuppressingNullArgumentPaths; + /// \sa getGraphTrimInterval llvm::Optional<unsigned> GraphTrimInterval; @@ -245,6 +248,17 @@ public: /// which accepts the values "true" and "false". bool shouldPruneNullReturnPaths(); + /// Returns whether a bug report should \em not be suppressed if its path + /// includes a call with a null argument, even if that call has a null return. + /// + /// This option has no effect when #shouldPruneNullReturnPaths() is false. + /// + /// This is a counter-heuristic to avoid false negatives. + /// + /// This is controlled by the 'avoid-suppressing-null-argument-paths' config + /// option, which accepts the values "true" and "false". + bool shouldAvoidSuppressingNullArgumentPaths(); + // Returns the size of the functions (in basic blocks), which should be // considered to be small enough to always inline. // diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h index a3784739d1..78e35ca82b 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h @@ -268,7 +268,11 @@ namespace bugreporter { /// \param IsArg Whether the statement is an argument to an inlined function. /// If this is the case, \p N \em must be the CallEnter node for /// the function. -void trackNullOrUndefValue(const ExplodedNode *N, const Stmt *S, BugReport &R, +/// +/// \return Whether or not the function was able to add visitors for this +/// statement. Note that returning \c true does not actually imply +/// that any visitors were added. +bool trackNullOrUndefValue(const ExplodedNode *N, const Stmt *S, BugReport &R, bool IsArg = false); const Stmt *GetDerefExpr(const ExplodedNode *N); |