[PATCH] D93464: [analyzer] Refine suppression mechanism to better support AST checks

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 17 08:57:48 PST 2020


vsavchenko created this revision.
Herald added subscribers: steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun, mgorny.
vsavchenko requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This commit slightly changes the way suppressions were checked before.
Instead of going up from statements and expressions, where bugs were
found, and looking for statements and declarations with attributes,
we traverse function bodies once and map locations with suppressions.

This approach can help with the majority of AST checks that report
directly on source locations.  It is not trivial to map locations
back to nodes, so its much easier to map both nodes and suppressions
to locations and reason only on that level.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93464

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
  clang/include/clang/StaticAnalyzer/Core/BugReporter/BugSuppression.h
  clang/lib/StaticAnalyzer/Core/BugReporter.cpp
  clang/lib/StaticAnalyzer/Core/BugSuppression.cpp
  clang/lib/StaticAnalyzer/Core/CMakeLists.txt
  clang/test/Analysis/suppression-attr.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93464.312525.patch
Type: text/x-patch
Size: 18132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201217/fbd27172/attachment-0001.bin>


More information about the cfe-commits mailing list