[cfe-dev] Proposed: change tracking for RegionStore

Jordy Rose jediknil at belkadan.com
Sun Aug 1 16:53:57 PDT 2010


On Sun, 1 Aug 2010 16:23:51 +0800, Zhongxing Xu <xuzhongxing at gmail.com>
wrote:
> Are we trying to solve the problem that, some checkers want to be
> informed when some region bindings are changed?
> 
> Can we do this:
> 
> GRExprEngine maintains a RegionWatcher, which is basically a map:
>       MemRegion *  => list of Checkers who are interested in the
MemRegion
> 
> Checkers first register themselves with the region they are interested
> in to the RegionWatcher.
> 
> In StoreManager::bind and other necessary places, call
> RegionWatcher::RegionChanged() with the new store and a list of
> changed regions. RegionWatcher then inform each Checker that
> registered before.

That's a good idea. I'd be a little worried transferring from one
GRExprEngine to the next during far inline calls, but I guess that can wait
until there's more support for that. (Plenty of checkers, for example,
assume the ASTContext doesn't change between invocations.) And I assume
these callbacks would happen at the end of the StoreManager public
interface methods.

I'd actually still like to push this up to GRStateManager, since that
would allow checkers to mess with their GDM store as a side effect of a
region change (in the case of CStringChecker, to invalidate any recorded
strlen).



More information about the cfe-dev mailing list