Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r1b5c81ed rf80e0218  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr  8 17:16:23 2016
    13 // Update Count     : 40
     12// Last Modified On : Mon Jun 13 16:03:39 2016
     13// Update Count     : 42
    1414//
    1515
     
    3232Expression::Expression( Expression *_aname ) : env( 0 ), argName( _aname ) {}
    3333
    34 Expression::Expression( const Expression &other ) : env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ) {
     34Expression::Expression( const Expression &other ) : env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ), extension( other.extension ) {
    3535        cloneAll( other.results, results );
    3636}
     
    6060                argName->print( os, indent+2 );
    6161        } // if
     62
     63        if ( extension ) {
     64                os << std::string( indent, ' ' ) << "with extension:";
     65        } // if
    6266}
    6367
     
    7276
    7377void ConstantExpr::print( std::ostream &os, int indent ) const {
    74         os << std::string( indent, ' ' ) << "constant expression " ;
     78        os << "constant expression " ;
    7579        constant.print( os );
    7680        Expression::print( os, indent );
    77         os << std::endl;
    7881}
    7982
    8083VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) {
     84        assert( var );
     85        assert( var->get_type() );
    8186        add_result( var->get_type()->clone() );
    8287        for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
     
    9398
    9499void VariableExpr::print( std::ostream &os, int indent ) const {
    95         os << std::string( indent, ' ' ) << "Variable Expression: ";
     100        os << "Variable Expression: ";
    96101
    97102        Declaration *decl = get_var();
     
    122127
    123128void SizeofExpr::print( std::ostream &os, int indent) const {
    124         os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
     129        os << "Sizeof Expression on: ";
    125130
    126131        if (isType)
     
    295300
    296301void CastExpr::print( std::ostream &os, int indent ) const {
    297         os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
     302        os << "Cast of:" << std::endl << std::string( indent+2, ' ' );
    298303        arg->print(os, indent+2);
    299304        os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
     
    318323
    319324void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
    320         os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
     325        os << "Untyped Member Expression, with field: " << get_member();
    321326
    322327        Expression *agg = get_aggregate();
    323         os << std::string( indent, ' ' ) << "from aggregate: ";
    324         if (agg != 0) agg->print(os, indent + 2);
     328        os << ", from aggregate: ";
     329        if (agg != 0) {
     330                os << std::string( indent + 2, ' ' );
     331                agg->print(os, indent + 2);
     332        }
     333        os << std::string( indent+2, ' ' );
    325334        Expression::print( os, indent );
    326335}
     
    345354
    346355void MemberExpr::print( std::ostream &os, int indent ) const {
    347         os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
     356        os << "Member Expression, with field: " << std::endl;
    348357
    349358        assert( member );
     
    354363        Expression *agg = get_aggregate();
    355364        os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
    356         if (agg != 0) agg->print(os, indent + 2);
     365        if (agg != 0) {
     366                os << std::string( indent + 2, ' ' );
     367                agg->print(os, indent + 2);
     368        }
     369        os << std::string( indent+2, ' ' );
    357370        Expression::print( os, indent );
    358371}
     
    372385
    373386void UntypedExpr::print( std::ostream &os, int indent ) const {
    374         os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
    375         function->print(os, indent + 4);
     387        os << "Applying untyped: " << std::endl;
     388        os << std::string( indent+2, ' ' );
     389        function->print(os, indent + 2);
    376390        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    377         printArgs(os, indent + 4);
     391        printAll(args, os, indent + 2);
    378392        Expression::print( os, indent );
    379393}
     
    381395void UntypedExpr::printArgs( std::ostream &os, int indent ) const {
    382396        std::list<Expression *>::const_iterator i;
    383         for (i = args.begin(); i != args.end(); i++)
     397        for (i = args.begin(); i != args.end(); i++) {
     398                os << std::string(indent, ' ' );
    384399                (*i)->print(os, indent);
     400        }
    385401}
    386402
     
    393409
    394410void NameExpr::print( std::ostream &os, int indent ) const {
    395         os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
     411        os << "Name: " << get_name() << std::endl;
    396412        Expression::print( os, indent );
    397413}
     
    454470}
    455471
     472
     473ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) {
     474        assert( callExpr );
     475        cloneAll( callExpr->get_results(), results );
     476}
     477
     478ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
     479        cloneAll( other.tempDecls, tempDecls );
     480        cloneAll( other.returnDecls, returnDecls );
     481        cloneAll( other.dtors, dtors );
     482}
     483
     484ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
     485        delete callExpr;
     486        deleteAll( tempDecls );
     487        deleteAll( returnDecls );
     488        deleteAll( dtors );
     489}
     490
     491void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
     492        os << std::string( indent, ' ' ) <<  "Implicit Copy Constructor Expression: " << std::endl;
     493        assert( callExpr );
     494        callExpr->print( os, indent + 2 );
     495        os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
     496        printAll(tempDecls, os, indent+2);
     497        os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;
     498        printAll(returnDecls, os, indent+2);
     499        Expression::print( os, indent );
     500}
     501
    456502UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    457503
Note: See TracChangeset for help on using the changeset viewer.