Hi.

In file source/Expression/ASTResultSynthesizer.cpp:98, we have:

       CompoundStmt *compound_stmt = dyn_cast<CompoundStmt>(function_body);



    bool ret = SynthesizeBodyResult (compound_stmt,

                                     function_decl);


And, in the "SynthesizeBodyResult" function:


bool

ASTResultSynthesizer::SynthesizeBodyResult (CompoundStmt *Body,

                                            DeclContext *DC)

{

    lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (
LIBLLDB_LOG_EXPRESSIONS));



    ASTContext &Ctx(*m_ast_context);



    CompoundStmt *compound_stmt = dyn_cast<CompoundStmt>(Body);



    if (!compound_stmt)

        return false;


…

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).

Regards,nbsp; Filipe
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to