<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Nov 5, 2011, at 12:11 AM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>This isn't correct.  We need the 'while' loop in case the ParenExpr wraps an OpaqueValueExpr, and vis versa.<br></div></blockquote><div><br></div><div>Ah ok, I didn't see your response before the changes. FWIW, my vote goes for</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #971365">static</span> <span style="color: #971365">const</span> <span style="color: #006244">Stmt</span> *LookThroughStmt(<span style="color: #971365">const</span> <span style="color: #006244">Stmt</span> *S) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">  <span style="color: #971365">if</span> (<span style="color: #971365">const</span> <span style="color: #006244">Expr</span> *E = dyn_cast<<span style="color: #006244">Expr</span>>(S))</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">    S = E->IgnoreParens();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(0, 98, 68); "><span style="color: #000000">  </span><span style="color: #971365">if</span><span style="color: #000000"> (</span><span style="color: #971365">const</span><span style="color: #000000"> </span>OpaqueValueExpr<span style="color: #000000"> *OVE = dyn_cast<</span>OpaqueValueExpr<span style="color: #000000">>(S))</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">    <span style="color: #971365">return</span> LookThroughStmt(OVE->getSourceExpr());</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(151, 19, 101); "><span style="color: #000000">  </span>return<span style="color: #000000"> S;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">}</div><div><br></div></div><br><blockquote type="cite"><div><br>On Nov 5, 2011, at 12:03 AM, Argyrios Kyrtzidis wrote:<br><br><blockquote type="cite">Author: akirtzidis<br></blockquote><blockquote type="cite">Date: Sat Nov  5 02:03:54 2011<br></blockquote><blockquote type="cite">New Revision: 143794<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=143794&view=rev">http://llvm.org/viewvc/llvm-project?rev=143794&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Simplify LookThroughStmt in LiveVariables.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">   cfe/trunk/lib/Analysis/LiveVariables.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp<br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=143794&r1=143793&r2=143794&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=143794&r1=143793&r2=143794&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/lib/Analysis/LiveVariables.cpp Sat Nov  5 02:03:54 2011<br></blockquote><blockquote type="cite">@@ -232,18 +232,10 @@<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">static const Stmt *LookThroughStmt(const Stmt *S) {<br></blockquote><blockquote type="cite">-  while (S) {<br></blockquote><blockquote type="cite">-    if (const ParenExpr *ParenE = dyn_cast<ParenExpr>(S)) {<br></blockquote><blockquote type="cite">-      S = ParenE->getSubExpr();<br></blockquote><blockquote type="cite">-      continue;<br></blockquote><blockquote type="cite">-    } else if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S)) {<br></blockquote><blockquote type="cite">-      S = OVE->getSourceExpr();<br></blockquote><blockquote type="cite">-      continue;<br></blockquote><blockquote type="cite">-    } else if (const Expr *E = dyn_cast<Expr>(S)) {<br></blockquote><blockquote type="cite">-      return E->IgnoreParens();<br></blockquote><blockquote type="cite">-    } else<br></blockquote><blockquote type="cite">-      break;<br></blockquote><blockquote type="cite">-  }<br></blockquote><blockquote type="cite">+  if (const Expr *E = dyn_cast<Expr>(S))<br></blockquote><blockquote type="cite">+    return E->IgnoreParens();<br></blockquote><blockquote type="cite">+  if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(S))<br></blockquote><blockquote type="cite">+    return OVE->IgnoreParens();<br></blockquote><blockquote type="cite">  return S;<br></blockquote><blockquote type="cite">}<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">cfe-commits mailing list<br></blockquote><blockquote type="cite"><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br></blockquote><blockquote type="cite"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br></blockquote><br></div></blockquote></div><br></body></html>