[analyzer][NFC] Prepare visitors for different tracking kinds
authorKristof Umann <dkszelethus@gmail.com>
Wed, 14 Aug 2019 00:48:57 +0000 (00:48 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Wed, 14 Aug 2019 00:48:57 +0000 (00:48 +0000)
commit3f7c66d551ef1210f1f48822e6bfef2e1b97881d
treecacda61d6037ef03debe32a5d4df00baf2c78119
parent2a39024ac822fb8e5fb4c1ad3b61697bced919e8
[analyzer][NFC] Prepare visitors for different tracking kinds

When we're tracking a variable that is responsible for a null pointer
dereference or some other sinister programming error, we of course would like to
gather as much information why we think that the variable has that specific
value as possible. However, the newly introduced condition tracking shows that
tracking all values this thoroughly could easily cause an intolerable growth in
the bug report's length.

There are a variety of heuristics we discussed on the mailing list[1] to combat
this, all of them requiring to differentiate in between tracking a "regular
value" and a "condition".

This patch introduces the new `bugreporter::TrackingKind` enum, adds it to
several visitors as a non-optional argument, and moves some functions around to
make the code a little more coherent.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-June/062613.html

Differential Revision: https://reviews.llvm.org/D64270

llvm-svn: 368777
clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
clang/lib/StaticAnalyzer/Checkers/MIGChecker.cpp
clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp
clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp