[PATCH] D103618: [analyzer] Change FindLastStoreBRVisitor to use Tracker

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 10 01:38:35 PDT 2021


vsavchenko added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:2274
+                                   const StackFrameContext *Origin) {
+  Tracker::create(Report)->track(V, R, Opts, Origin);
+}
----------------
NoQ wrote:
> How does lifetime work here? Do I understand correctly that the tracker is only kept alive by the `FindLastStoreBRVisitor` instance, even after its completion?
Correct, every `TrackingVisitor` keeps its parent tracker alive.  We can optimize it a bit by setting it to `null` when the visitor is done early.  But it feels like such a negligible gain that I didn't bother.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103618



More information about the cfe-commits mailing list