Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r0661678 redbdbe6  
    619619
    620620                Expression * FixCopyCtors::mutate( StmtExpr * stmtExpr ) {
    621                         // function call temporaries should be placed at statement-level, rather than nested inside of a new statement expression,
    622                         // since temporaries can be shared across sub-expressions, e.g.
    623                         //   [A, A] f();
    624                         //   g([A] x, [A] y);
    625                         //   f(g());
    626                         // f is executed once, so the return temporary is shared across the tuple constructors for x and y.
    627                         std::list< Statement * > & stmts = stmtExpr->get_statements()->get_kids();
    628                         for ( Statement *& stmt : stmts ) {
    629                                 stmt = stmt->acceptMutator( *this );
    630                         } // for
    631                         // stmtExpr = safe_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );
     621                        stmtExpr = safe_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );
    632622                        assert( stmtExpr->get_result() );
    633623                        Type * result = stmtExpr->get_result();
     
    896886                        Parent::visit( compoundStmt );
    897887
    898                         // add destructors for the current scope that we're exiting, unless the last statement is a return, which
    899                         // causes unreachable code warnings
     888                        // add destructors for the current scope that we're exiting
    900889                        std::list< Statement * > & statements = compoundStmt->get_kids();
    901                         if ( ! statements.empty() && ! dynamic_cast< ReturnStmt * >( statements.back() ) ) {
    902                                 insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) );
    903                         }
     890                        insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) );
    904891                        reverseDeclOrder.pop_front();
    905892                }
Note: See TracChangeset for help on using the changeset viewer.