I implemented a minimum patch that set up the CFGElement hierarchy based on Marcin's patch.<br><br>I use 2 pointers directly in CFGElement, because this make logic simpler and we can optimize it anytime later.<br>The first pointer's integer bits are used to mark the main kind of the CFGElement. The second are used to mark the kind of dtors.<br>
<br>Scopes are removed since we haven't decided if to include it. Other parts are necessary adaption to the new CFGElement interface. <br><br>This should be easier to review.<br><br><div class="gmail_quote">2010/9/7 Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br><br><div class="gmail_quote">2010/9/7 Marcin Świderski <span dir="ltr"><<a href="mailto:marcin.sfider@gmail.com" target="_blank">marcin.sfider@gmail.com</a>></span><div>
<div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote">W dniu 6 września 2010 07:49 użytkownik Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com" target="_blank">xuzhongxing@gmail.com</a>></span> napisał:<div><div></div><div>
<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><br><div class="gmail_quote">2010/9/6 Marcin Świderski <span dir="ltr"><<a href="mailto:marcin.sfider@gmail.com" target="_blank">marcin.sfider@gmail.com</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



<div class="gmail_quote">W dniu 6 września 2010 05:37 użytkownik Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com" target="_blank">xuzhongxing@gmail.com</a>></span> napisał:<div><div></div><div>
<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Marcin,<br><br>Thank you for working on this. This patch is really big. I suggest we focus on the 'CFGElement' aspect in the first patch, and put the 'LocalScope' things in later patches.<br><br>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. <br>






<br>Then for the rest one pointer, we let it point to the VarDecl for AutomaticObjectDtor, to the initializer for Base and Member dtors, to CXXBindTemporaryExpr for temporary dtor.<br><br><div class="gmail_quote">2010/9/3 Marcin Świderski <span dir="ltr"><<a href="mailto:marcin.sfider@gmail.com" target="_blank">marcin.sfider@gmail.com</a>></span><div>




<div></div><div><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi<div><br></div><div>I'm sending a patch with implementation of C++</div><div>- initializers from constructor initialization list,</div><div>- implicit destructors for objects with automatic storage duration.</div><div>







<br></div><div>For destructors I've taken care of:</div><div>- block local scopes,</div><div>- if/switch/for/while/do local scopes (in case there's no block),</div><div>- if/switch/for/while condition variables,</div>







<div>- catch exception variable,</div><div>- temporaries bound to const reference.</div><div><br></div><div>Is there something that I've missed?</div><div><br></div><div>As it have been suggested I've created hierarchy of CFGElements. Currently there're two unused types for implicit destructor calls in destructor. I've did not revert ability of CFGElement to cast/dyn_cast to Stmt, because it would lead to situation when cast<Stmt>(SomeCFGElement) would return null. I did however add method for downcasting CFGElement object to object of its implemntation class (returned by value, not pointer) with returning invalid object on invalid cast.</div>







<div><br></div><div>I did not add CFGElement for destructors of temporary objects. After giving it some thought I came to a conclusion that it shouldn't be covered by CFG, because it clearly needs path-sensitiveness.</div>







<div><br></div><div>Cheers</div><div>Marcin</div>
</blockquote></div></div></div><br>
</blockquote></div></div></div>Should I split it and send it cfe-commits with some comments?
</blockquote></div></div></div><br><div>Yes, I would like we settle down the CFGElement part first, then the CFG construction part.</div>
</blockquote></div></div></div><div>I won't be able to prepare patches before the weekend. I hope it won't be much of a problem to anyone.</div><div><br></div><div>As I understand each patch should introduce chunk of code that would not break the compilation?</div>


<div><br></div><div>Cheers</div><div>Marcin</div>
</blockquote></div></div></div><br><div>Hi Marcin,</div><div><br></div><div>I will try to review this one, since splitting this patch may cause much trouble for you.</div>
</blockquote></div><br>