[cfe-dev] Any plans to rework NoStoreFuncVisitor as well?
Valeriy Savchenko via cfe-dev
cfe-dev at lists.llvm.org
Wed Jun 30 06:17:05 PDT 2021
Hi Kristóf,
In my opinion, this is the checker’s logic and it shouldn’t live inside of `NoStoreFuncVisitor`. However, I think that `NoStateChangeFuncVisitor` can require an extra step for the users.
During my big discussion with Artem in the patchset, where I introduced the `Tracker` interface, I suggested to extract different bits of what I called “events” from different parts of `trackExpressionValue`, so that checkers can react on those events. At first, we make it part of the tracker mechanism, so we detect them during this stage, and later we can put special tags on the nodes.
Long story short, I think that `NoStore` is event and with that it is similar to `Store`. We can introduce `NoStoreHandler` (probably we can come up with a better name than that), that produces the note, just like `StoreHandler` does. And the user can plug in their own handler to produce customized note.
What do you think about this?
Valeriy
> On 30 Jun 2021, at 15:57, Kristóf Umann <dkszelethus at gmail.com> wrote:
>
> Hi!
>
> Just a quick one -- I want to generalize NoStoreFuncVisitor to be able to construct messages such as "Returning without deallocating or changing the ownership of allocated memory". The grand idea is to create a NoStateChangeFuncVisitor base class that can be specialized for what a (lack of a) state change is.
>
> Are there any similar ongoing efforts or shall I proceed?
>
> Cheers,
> Kristóf
More information about the cfe-dev
mailing list