<br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 1:11 PM, Zhongxing Xu <span dir="ltr"><<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 1:08 PM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank">kremenek@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;"><div><div></div><div><br><div><div>On Jun 2, 2010, at 10:04 PM, Zhongxing Xu wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 1:02 PM, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank">kremenek@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;"><div><br><div><div>On Jun 2, 2010, at 9:48 PM, Zhongxing Xu wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


Is it necessary to add all RHS of assignment expr as block-level expr?<br><br>+    return addStmt(B->getLHS(), AddStmtChoice::AsLValueNotAlwaysAdd);<br>+  }<br></blockquote><div><br>Here better to use visitStmt, because addStmt() means we want to 'add' the statement. Maybe we should modify some of the existing code to emphasize this.<br>


 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> </blockquote></span></blockquote></div><div><br></div></div><div>That's right.  The rest of the cases in that method use addStmt() because they introduce real control-flow dependencies.  For the assignment operator this isn't need.</div>


<div><br></div><div>Zhongxing: I don't think any of the existing cases in that method need to be modified to use VisitStmt() instead of addStmt(), or do you see something?</div></div></blockquote></div><br>I suggest the following implementation of addStmt.<br>


<br>CFGBlock *addStmt(Stmt *S) {<br>    return Visit(S, AddStmtChoice::AlwaysAdd);<br>}<br>
</blockquote></div><br></div></div><div>That would break a fair number of the existing callers, as some use the second argument to indicate that the expression should be treated as an lvalue.</div><div><div><br></div><div>

<br></div></div></div></blockquote></div></div></div>Maybe those could use VisitStmt directly?<br>
</blockquote></div><br>correction: use Visit()<br>