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>
<p class="p2">    </p>
<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><p class="p1"><font class="Apple-style-span" face="arial, helvetica, sans-serif" size="2">
</font></p><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>
<p class="p3">    </p>
<p class="p4"><span class="s1">    </span>ASTContext<span class="s1"> &Ctx(*</span>m_ast_context<span class="s1">);</span></p>
<p class="p3">    </p>
<p class="p1">    <span class="s3">CompoundStmt</span> *compound_stmt = <span class="s4">dyn_cast</span><<span class="s3">CompoundStmt</span>>(Body);</p>
<p class="p3">    </p>
<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><p></p></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>