[all-commits] [llvm/llvm-project] 9cca5c: [analyzer] Make checker silencing work for non-pat...

Kristóf Umann via All-commits all-commits at lists.llvm.org
Thu Jun 17 01:28:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9cca5c1391d637b5500ada646cf136ddb38254a3
      https://github.com/llvm/llvm-project/commit/9cca5c1391d637b5500ada646cf136ddb38254a3
  Author: Kirstóf Umann <dkszelethus at gmail.com>
  Date:   2021-06-17 (Thu, 17 Jun 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/BugReporter.cpp
    R clang/test/Analysis/silence-checkers-malloc.cpp
    A clang/test/Analysis/silence-checkers.cpp

  Log Message:
  -----------
  [analyzer] Make checker silencing work for non-pathsensitive bug reports

D66572 separated BugReport and BugReporter into basic and path sensitive
versions. As a result, checker silencing, which worked deep in the path
sensitive report generation facilities became specific to it. DeadStoresChecker,
for instance, despite being in the static analyzer, emits non-pathsensitive
reports, and was impossible to silence.

This patch moves the corresponding code before the call to the virtual function
generateDiagnosticForConsumerMap (which is overriden by the specific kinds of
bug reporters). Although we see bug reporting as relatively lightweight compared
to the analysis, this will get rid of several steps we used to throw away.

Quoting from D65379:

At a very high level, this consists of 3 steps:

For all BugReports in the same BugReportEquivClass, collect all their error
nodes in a set. With that set, create a new, trimmed ExplodedGraph whose leafs
are all error nodes.
Until a valid report is found, construct a bug path, which is yet another
ExplodedGraph, that is linear from a given error node to the root of the graph.
Run all visitors on the constructed bug path. If in this process the report got
invalidated, start over from step 2.
Checker silencing used to kick in after all of these. Now it does before any of
them :^)

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

Change-Id: Ice42939304516f2bebd05a1ea19878b89c96a25d




More information about the All-commits mailing list