Changeset d7903b1


Ignore:
Timestamp:
May 2, 2016, 3:19:54 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, with_gc
Children:
2e3a379
Parents:
fbfde843 (diff), 60089f4 (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 'fix-tree-printing' into ctor

Conflicts:

src/SynTree/CommaExpr.cc
src/SynTree/CompoundStmt.cc

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    rfbfde843 rd7903b1  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // utility.h -- 
     7// utility.h --
    88//
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul  2 18:04:41 2015
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Thu Apr 28 13:18:24 2016
    1313// Update Count     : 16
    1414//
     
    6262                        os << std::string( indent,  ' ' );
    6363                        (*i)->print( os, indent + 2 );
     64                        // need an endl after each element because it's not easy to know when each individual item should end
    6465                        os << std::endl;
    6566                } // if
     
    128129}
    129130
    130 template < typename T > 
     131template < typename T >
    131132std::string toString ( T value ) {
    132133        std::ostringstream os;
  • src/SynTree/CommaExpr.cc

    rfbfde843 rd7903b1  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 06 17:07:54 2016
     12// Last Modified On : Mon May 02 15:19:44 2016
    1313// Update Count     : 1
    1414//
     
    2121                : Expression( _aname ), arg1( arg1 ), arg2( arg2 ) {
    2222        // xxx - result of a comma expression is never an lvalue, so should set lvalue
    23         // to false on all result types
     23        // to false on all result types. Actually doing this causes some strange things
     24        // to happen in later passes (particularly, Specialize, Lvalue, and Box). This needs to be looked into.
    2425        cloneAll( arg2->get_results(), get_results() );
     26        // for ( Type *& type : get_results() ) {
     27        //      type->set_isLvalue( false );
     28        // }
    2529}
    2630
     
    3539
    3640void CommaExpr::print( std::ostream &os, int indent ) const {
    37         os << std::string( indent, ' ' ) << "Comma Expression:" << std::endl;
     41        os << "Comma Expression:" << std::endl;
     42        os << std::string( indent+2, ' ' );
    3843        arg1->print( os, indent+2 );
    3944        os << std::endl;
     45        os << std::string( indent+2, ' ' );
    4046        arg2->print( os, indent+2 );
    4147        Expression::print( os, indent );
  • src/SynTree/CompoundStmt.cc

    rfbfde843 rd7903b1  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 06 14:35:37 2016
     12// Last Modified On : Mon May 02 15:19:17 2016
    1313// Update Count     : 3
    1414//
     
    8484
    8585void CompoundStmt::print( std::ostream &os, int indent ) const {
    86         os << string( indent, ' ' ) << "CompoundStmt" << endl ;
     86        os << "CompoundStmt" << endl ;
    8787        printAll( kids, os, indent + 2 );
    8888}
  • src/SynTree/Expression.cc

    rfbfde843 rd7903b1  
    7272
    7373void ConstantExpr::print( std::ostream &os, int indent ) const {
    74         os << std::string( indent, ' ' ) << "constant expression " ;
     74        os << "constant expression " ;
    7575        constant.print( os );
    7676        Expression::print( os, indent );
     
    383383void UntypedExpr::print( std::ostream &os, int indent ) const {
    384384        os << "Applying untyped: " << std::endl;
    385         os << std::string( indent, ' ' );
     385        os << std::string( indent+4, ' ' );
    386386        function->print(os, indent + 4);
    387387        os << std::string( indent, ' ' ) << "...to: " << std::endl;
    388         os << std::string( indent, ' ' );
    389         printArgs(os, indent + 4);
     388        printAll(args, os, indent + 4);
    390389        Expression::print( os, indent );
    391390}
     
    393392void UntypedExpr::printArgs( std::ostream &os, int indent ) const {
    394393        std::list<Expression *>::const_iterator i;
    395         for (i = args.begin(); i != args.end(); i++)
     394        for (i = args.begin(); i != args.end(); i++) {
     395                os << std::string(indent, ' ' );
    396396                (*i)->print(os, indent);
     397        }
    397398}
    398399
  • src/SynTree/Initializer.cc

    rfbfde843 rd7903b1  
    4545void SingleInit::print( std::ostream &os, int indent ) {
    4646        os << std::endl << std::string(indent, ' ' ) << "Simple Initializer: " << std::endl;
     47        os << std::string(indent+4, ' ' );
    4748        value->print( os, indent+4 );
    4849
  • src/SynTree/Statement.cc

    rfbfde843 rd7903b1  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Apr 26 12:33:33 2016
     12// Last Modified On : Thu Apr 28 13:34:32 2016
    1313// Update Count     : 54
    1414//
     
    128128void IfStmt::print( std::ostream &os, int indent ) const {
    129129        os << "If on condition: " << endl ;
     130        os << string( indent+4, ' ' );
    130131        condition->print( os, indent + 4 );
    131132
    132         os << string( indent, ' ' ) << ".... and branches: " << endl;
    133 
     133        os << string( indent+2, ' ' ) << "... then: " << endl;
     134
     135        os << string( indent+4, ' ' );
    134136        thenPart->print( os, indent + 4 );
    135137
    136138        if ( elsePart != 0 ) {
     139                os << string( indent+2, ' ' ) << "... else: " << endl;
     140                os << string( indent+4, ' ' );
    137141                elsePart->print( os, indent + 4 );
    138142        } // if
Note: See TracChangeset for help on using the changeset viewer.