[PATCH] D98741: [analyzer] Introduce common bug category "Unused code".

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 16 13:40:02 PDT 2021


NoQ created this revision.
NoQ added reviewers: vsavchenko, xazax.hun, Szelethus, martong, baloghadamsoftware, Charusso, steakhal, balazske, ASDenysPetrov.
Herald added subscribers: dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet.
NoQ requested review of this revision.

This is a cosmetic change. "Dead store" will now be displayed as "Unused code" which is a nice broad category that could incorporate more than one checker. It also doesn't mention dead people which despite being a common source of inside jokes in the static analyzer community doesn't need to be translated onto innocent users.

There's one more alpha checker that fits into the category, namely UnreachableCode checker which flags code that wasn't covered by symbolic execution. I don't immediately plan to actually make this checker useful as it has to be quite an undertaking.

A broader plan that i have here is that some clang-tidy checks (eg., bugprone-redundant-branch-condition or misc-redundant-expression) can be put into that category through D95403 <https://reviews.llvm.org/D95403>.


Repository:
  rC Clang

https://reviews.llvm.org/D98741

Files:
  clang/include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h
  clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
  clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp
  clang/lib/StaticAnalyzer/Core/CommonBugCategories.cpp
  clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
  clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
  clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98741.331090.patch
Type: text/x-patch
Size: 8842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210316/a4c05cc7/attachment-0001.bin>


More information about the cfe-commits mailing list