[PATCH] D104136: [analyzer] Add better tracking for RetainCountChecker leak warnings

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 15 02:20:42 PDT 2021


vsavchenko added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp:953-957
+      // Let's traverse...
+      for (const ExplodedNode *N = ExprNode;
+           // ...all the nodes corresponding to the given expression...
+           N != nullptr && N->getStmtForDiagnostics() == E;
+           N = N->getFirstPred()) {
----------------
NoQ wrote:
> I guess this part should ultimately be written in one place, eg. `ExplodedNode::findTag()` or something like that.
> 
> I'd also really like to explore the possibility to further limit the variety of nodes traversed here. What nodes are typically traversed here? Is it checker-tagged nodes or is it purge dead symbol nodes or something else?
Yes, `ExplodedNode::findTag()` sounds like a great idea!

I mean it is hard to tell without calculating statistics right here and running it on a bunch of projects.  However, it is always possible to write the code that will have it the other way.  My take on it is that it is probably a mix of things.

I'd also prefer to traverse less, do you have any specific ideas here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104136/new/

https://reviews.llvm.org/D104136



More information about the cfe-commits mailing list