[cfe-dev] CFG initializers and destructors patch

Ted Kremenek kremenek at apple.com
Sun Sep 5 21:57:12 PDT 2010


On Sep 5, 2010, at 8:37 PM, Zhongxing Xu wrote:

> About CFGElement, I think we an avoid using two pointers in it. Currently the second pointer data is used for 'the statement that triggers the dtor. I think we don't need a pointer for it. The position where the CFGElement resides is the place where it is triggered. It is not triggered by a statement. 

One thing to keep in mind is that we will want the ability to distinguish different CFGImplicitDtor's that represent the destruction of the same object (at different locations).  This will be need for creating ProgramPoints, both for the flow-sensitive and path-sensitive engines, that we can use as points to anchor dataflow facts at unique locations.  With Stmt's, for the most part a single Stmt* appears once in a CFG (thus creating unique ProgramPoints).  That isn't the case for destructors of the same object.  This means we will likely need a second field in CFGElement that has some data that uniquely distingues them.  If that is the call location, then that might be unique enough.

My guiding advice is that we shouldn't worry too much about optimizing away the second pointer until we know we have this working not only in the CFG, but also the dataflow engines.



More information about the cfe-dev mailing list