Ignore:
Timestamp:
Dec 13, 2016, 5:37:15 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
31f379c
Parents:
1d2b64f
Message:

change rework TupleAssignExpr? and StmtExpr?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r1d2b64f rd5556a3  
    524524
    525525ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
     526        set_env( nullptr ); // ImplicitCopyCtorExpr does not take ownership of an environment
    526527        delete callExpr;
    527528        deleteAll( tempDecls );
     
    533534        os <<  "Implicit Copy Constructor Expression: " << std::endl;
    534535        assert( callExpr );
     536        os << std::string( indent+2, ' ' );
    535537        callExpr->print( os, indent + 2 );
    536538        os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
     
    584586        os << std::string( indent+2, ' ' );
    585587        initializer->print( os, indent + 2 );
     588        Expression::print( os, indent );
    586589}
    587590
     
    603606        os << " ... ";
    604607        high->print( os, indent );
     608        Expression::print( os, indent );
    605609}
    606610
     
    614618        }
    615619}
    616 StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) {}
     620StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) {
     621        cloneAll( other.returnDecls, returnDecls );
     622        cloneAll( other.dtors, dtors );
     623}
    617624StmtExpr::~StmtExpr() {
    618625        delete statements;
     626        deleteAll( dtors );
     627        deleteAll( returnDecls );
    619628}
    620629void StmtExpr::print( std::ostream &os, int indent ) const {
    621630        os << "Statement Expression: " << std::endl << std::string( indent, ' ' );
    622631        statements->print( os, indent+2 );
     632        if ( ! returnDecls.empty() ) {
     633                os << std::string( indent+2, ' ' ) << "with returnDecls: ";
     634                printAll( returnDecls, os, indent+2 );
     635        }
     636        if ( ! dtors.empty() ) {
     637                os << std::string( indent+2, ' ' ) << "with dtors: ";
     638                printAll( dtors, os, indent+2 );
     639        }
     640        Expression::print( os, indent );
    623641}
    624642
     
    644662        get_expr()->print( os, indent+2 );
    645663        if ( get_object() ) {
    646                 os << " with decl: ";
     664                os << std::string( indent+2, ' ' ) << "with decl: ";
    647665                get_object()->printShort( os, indent+2 );
    648666        }
     667        Expression::print( os, indent );
    649668}
    650669
Note: See TracChangeset for help on using the changeset viewer.