<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Filipe,<div><br></div><div>thank you for spotting this!  I have fixed the offending code.</div><div><br></div><div>Sean</div><div><br><div><div>On Jul 18, 2011, at 2:09 PM, Filipe Cabecinhas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi.<div><br></div><div>In file source/Expression/ASTResultSynthesizer.cpp:98, we have:</div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1038.36">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px}
span.s1 {color: #607f87}
span.s2 {color: #3f575d}
span.s3 {color: #a13fa1}
</style><p class="p1">    <span class="s1">CompoundStmt</span> *compound_stmt = <span class="s2">dyn_cast</span><<span class="s1">CompoundStmt</span>>(function_body);</p><div>    <br class="webkit-block-placeholder"></div><p class="p1">    <span class="s3">bool</span> ret = <span class="s2">SynthesizeBodyResult</span> (compound_stmt,</p><p class="p1">                                     function_decl);</p><p class="p1"><br></p><p class="p1"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">And, in the "SynthesizeBodyResult" function:</font></p><p class="p1"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2"><br></font></p><div><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
</font><br class="webkit-block-placeholder"></div><p class="p2"><font class="Apple-style-span" size="2" face="'courier new', monospace">bool<span class="s1"> </span></font></p><font class="Apple-style-span" size="2" face="'courier new', monospace"><p class="p1">ASTResultSynthesizer::SynthesizeBodyResult (CompoundStmt *Body, </p><p class="p1">                                            DeclContext *DC)</p><p class="p1">{</p><p class="p1">    lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (<span class="s2">LIBLLDB_LOG_EXPRESSIONS</span>));</p><div>    <br class="webkit-block-placeholder"></div><p class="p4"><span class="s1">    </span>ASTContext<span class="s1"> &Ctx(*</span>m_ast_context<span class="s1">);</span></p><div>    <br class="webkit-block-placeholder"></div><p class="p1">    <span class="s3">CompoundStmt</span> *compound_stmt = <span class="s4">dyn_cast</span><<span class="s3">CompoundStmt</span>>(Body);</p><div>    <br class="webkit-block-placeholder"></div><p class="p1">    <span class="s5">if</span> (!compound_stmt)</p><p class="p2"><span class="s1">        </span>return<span class="s1"> </span>false<span class="s1">;</span></p></font><div><br class="webkit-block-placeholder"></div></div><div><br></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"></font></div>
<div><br></div><div>Can't we remove the second cast? (The method is only called in the above snippet) We can maintain the check (or check it before, right after the dyn_cast).</div><div><br></div><div>Regards,nbsp; Filipe<br>
<br>
</div>
_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev<br></blockquote></div><br></div></body></html>