[cfe-commits] [PATCH] CFG automatic object destructors

Zhongxing Xu xuzhongxing at gmail.com
Tue Sep 28 01:49:08 PDT 2010


2010/9/28 Marcin Świderski <marcin.sfider at gmail.com>

> Hi Ted, Zhongxing
>
> I'll do this testing thing, then add changes from this patch, after fixing
> issues that were pointed out.


Great.


>
> As for change in return statement handling, will you be able to make it,
> because I don't know if I will be able to fix all issues this can introduce?
>

This hasn't been well discussed. So don't worry about it for now.


>
> 2010/9/28 Ted Kremenek <kremenek at apple.com>
>
> Not sure about this one, but it might make sense to make ReturnStmt a
>> terminator anyway.  There's a couple issues to think about here, including
>> how we will model CallEnter/CallReturns for inter-procedural analysis in the
>> presence of dtors.  My initial thought is the ReturnStmt should be the site
>> of the "jump" back to the caller, which means that dtors need to be in the
>> cfg before the ReturnStmt itself.  It's not hard to modify the analysis
>> engine (in a separate patch) to have ReturnStmt be a terminator if that is
>> the right thing to do.
>>
>> On Sep 27, 2010, at 10:18 PM, Zhongxing Xu <xuzhongxing at gmail.com> wrote:
>>
>> I might be wrong. Shall we add the implicit dtor before or after the
>> return stmt? I guess we should add them after the return stmt, since object
>> may be returned. But that means we would have CFGElements after the
>> terminator.
>>
>> 2010/9/28 Zhongxing Xu < <xuzhongxing at gmail.com>xuzhongxing at gmail.com>
>>
>>> Hi Marcin,
>>>
>>> There are some bugs in your patch. I tested with the code attached. The
>>> printed CFG has some errors in block B2.
>>>
>>> I'll look at the patch to try to locate the bug.
>>>
>>> 2010/9/28 Marcin Świderski < <marcin.sfider at gmail.com>
>>> marcin.sfider at gmail.com>
>>>
>>> Patch adds implicit destructors generation for objects with automatic
>>>> storage duration. Patch is rather big, but it contains all cases (that I
>>>> thought of), as it will be easier to review as a whole IMO. While commiting
>>>> I can divide it to smaller chuncks.
>>>>
>>>> I've added some test cases. They can be later used to create regresion
>>>> tests.
>>>>
>>>> Please approve for commit.
>>>>
>>>> Marcin
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100928/dcd9e7b7/attachment.html>


More information about the cfe-commits mailing list