[clang] [clang][analyzer] Clear `ObjCMethodCall`'s cache between runs (PR #161327)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 30 08:18:42 PDT 2025
balazs-benics-sonarsource wrote:
> > I remember debugging this. Fun times. I wonder if we could do even better by smuggling in some reference to that helper function, so we could move that global into a field. E.g. as a sibling of the allocator pool.
>
> I have been looking at this, and I am not sure is it worth? IIUC the allocator comes from `ExprEngine.Engine.G`, and the `CallEventManager` belongs to `ProgramStateManager` that also belongs to the `ExprEngine`. So they should be destroyed at the "same" time. This said, instead of having a static, just having it be a member of `CallEvenManager` should be equivalent (and thread safe), shouldn't it?
Technically the solution is correct. It's just a matter of taste of using globals. That said, I'm not opposing, I just wanted to know if you considered this at all. It seems you did, so if you say it's not worth it, I'm not going to insist.
https://github.com/llvm/llvm-project/pull/161327
More information about the cfe-commits
mailing list