[PATCH] D103605: [analyzer] Introduce a new interface for tracking

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 10 23:39:20 PDT 2021


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Ok this is amazing, no more comments!!



================
Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:210
+  ///        much.
+  virtual Result track(KnownSVal V, const MemRegion *R,
+                       TrackingOptions Opts = {},
----------------
vsavchenko wrote:
> NoQ wrote:
> > vsavchenko wrote:
> > > NoQ wrote:
> > > > xazax.hun wrote:
> > > > > Not directly related to this patch, but I wonder if we want to have unknown values with identities at some point, so we can track them.
> > > > `UnknownVal` is a stop-gap for situations when we've screwed up so badly we don't even have types anymore. The only thing I'd ever want from them is to disappear :)
> > > > 
> > > > I guess this could be useful for a debug checker that could explain where does an `UnknownVal` come from. In this case unknown values don't need identities; we can track other values without identities, such as null pointers, just fine.
> > > +1 for not caring about `UnknownVal`.
> > That said, I'd rather not force the caller to perform a `getAs<>()`. It's pretty cumbersome and we can do the right thing (ignore it) in the callee anyway.
> OK, I see, so we can call it with whatever value, but track only known values, correct?
Yup!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103605



More information about the cfe-commits mailing list