[cfe-commits] r91535 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h include/clang/Analysis/PathSensitive/MemRegion.h include/clang/Analysis/PathSensitive/Store.h lib/Analysis/GRExprEngine.cpp lib/Analysis/MemRegion.cpp lib/A

Chris Lattner clattner at apple.com
Wed Dec 16 20:50:02 PST 2009


On Dec 16, 2009, at 8:30 PM, Ted Kremenek wrote:

> 
> On Dec 16, 2009, at 5:47 PM, Zhongxing Xu wrote:
> 
>> 2009/12/17 Ted Kremenek <kremenek at apple.com>:
>>> Hi Zhongxing,
>>> 
>>> How do we plan on using CXXObjectRegion?
>>> 
>>> For stack allocated objects, we will use VarRegions.  For heap allocated (e.g., 'new'), we will use SymbolicRegions.  For fields that are C++ objects we will use FieldRegions.
>>> 
>> 
>> My feeling is that c++ objects may have some properties that justify
>> it to be a separate region, like the vtable pointer. But apparently we
>> haven't got there.
> 
> If we wanted to represent the vtable pointer we have a variety of options, like having something similar to FieldRegion, e.g., VTablePtrRegion, that allows us to attach the vtable pointer as a "property" of another region.  That way a VarRegion could represent a stack allocated object, a SymbolicRegion an objected created using 'new', etc.

One other aspect that might impact the design is that the vtable pointer changes during object construction and destruction.  This makes it very much like a field of an object, not a property of the object as a whole.

-Chris



More information about the cfe-commits mailing list