[cfe-dev] Fwd: CFGElement changes and initializers addition (with patch)
Zhongxing Xu
xuzhongxing at gmail.com
Tue Aug 24 00:59:35 PDT 2010
2010/8/20 Marcin Świderski <marcin.sfider at gmail.com>:
> Sorry, I still forget to choose "Replay all" option...
> W dniu 20 sierpnia 2010 05:35 użytkownik Ted Kremenek <kremenek at apple.com>
> napisał:
>>
>> On Aug 18, 2010, at 12:11 AM, Marcin Świderski wrote:
>>
>> Hi Jordy, Ted
>> Thanks for the appreciation and for comments. Some comments inline:
>> W dniu 18 sierpnia 2010 07:47 użytkownik Jordy Rose
>> <jediknil at belkadan.com> napisał:
>>>
>>> Wow, good work.
>>>
>>> I agree with most of what Ted said. A few additional comments:
>>>
>>> - I like the single enum rather than kind and subkind, but there are 7
>>> elements, not 6. So it won't fit in a PointerIntPair anyway, though
>>> having
>>> a Stmt* field (or void*) and an enum field would be preferable to two
>>> PointerIntPairs.
>>> I'm still not totally convinced we need scope markers in the CFG, though.
>>>
>> For both destructor kinds I will need space for two pointers. For
>> automatic object I need it's declaration and statement that cause destructor
>> to be called. For temporary object I need expression bound to the temporary
>> and the full expression that contains the temporary.
>>
>> Repeating what I said in my reply to Jordy, I think it's fine to burn an
>> extra pointer if it gives us flexibility to track more information that
>> would be useful for diagnostics.
>
> So I have three acceptable solutions.
> 1. Two pointers for each element.
> 2. One pointer for each element, but in case of destructor it points to
> allocated pair of pointers.
> 3. One pointer for each element, and location of call to destructor is
> calculated on demand.
> 1 is wasteful, because only destructors need two pointers. 3 will give as
> possibly unclean API for clients. 2 seams to be the best and I will
> implement it.
>>
I think 1 is affordable, and it would provide a clean implementation.
Suppose we analyze 1 million lines of code, roughly equivalent to 1
million stmts. Each CFGElement takes a pointer of 8 bytes. It only
consumes 7 MB extra memory.
More information about the cfe-dev
mailing list