[cfe-dev] CFRefCount Problem #2: Region Invalidation

Ted Kremenek kremenek at apple.com
Wed Aug 24 11:21:06 PDT 2011


On Aug 23, 2011, at 10:08 PM, Jordy Rose wrote:

>> Is there a particular reason you were advocating (1)?
> 
> (1) is the least intrusive implementation, and it's an implementation that doesn't impose additional semantics on invalidateRegion(s).

I don't think I quite understand (1).  Could you explain a bit more what you had in mind?  To me, restoring bindings in the store has nothing to do with whether or not a symbol gets invalidated.

> What I didn't realize is that invalidateRegions is /only/ used for parameters.

I'm not certain what you mean.  It's a general API, that is meant to be used to invalidate any set of regions, starting with region roots.  invalidateRegions is also used to invalidate globals.  Yes, we use it right now to invalidate parameters, but it could certainly be used in other cases.

> That means that passing the top-level parameters isn't really changing any semantics. So I'm good with (2).

Ah, you mean by extending the API and making it too specialized?

> Is it best to pass a list of SVals? A list of top-level regions? A list of expressions? A list of symbols? A CallOrObjCMessage? The last is clearly most flexible, but I'm not sure that's what we need. I feel like the list of SVals (ArrayRef<SVal>) is probably the way to go.

Maybe just the list of MemRegion roots and an *optional* ProgramPoint?  The latter could be used to tailor the behavior of the callback.  SVals are really one level too high, since this API really is about regions.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110824/2f82a362/attachment.html>


More information about the cfe-dev mailing list