Changeset f5854507


Ignore:
Timestamp:
Oct 5, 2017, 11:53:12 AM (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:
6bbce58
Parents:
bb9d8e8
Message:

Add debug prints to TupleAssignment?.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    rbb9d8e8 rf5854507  
    4141#include "SynTree/Visitor.h"               // for Visitor
    4242
     43#if 0
     44#define PRINT(x) x
     45#else
     46#define PRINT(x)
     47#endif
     48
    4349namespace Tuples {
    4450        class TupleAssignSpotter {
     
    119125                if (  NameExpr *op = dynamic_cast< NameExpr * >(expr->get_function()) ) {
    120126                        if ( CodeGen::isCtorDtorAssign( op->get_name() ) ) {
    121                                 fname = op->get_name();
     127                               fname = op->get_name();
     128                                PRINT( std::cerr << "TupleAssignment: " << fname << std::endl; )
    122129                                for ( std::list<ResolvExpr::AltList>::const_iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) {
    123130                                        if ( ali->size() == 0 ) continue; // AlternativeFinder will natrually handle this case, if it's legal
     
    131138                                        const ResolvExpr::Alternative & alt1 = ali->front();
    132139                                        auto begin = std::next(ali->begin(), 1), end = ali->end();
     140                                        PRINT( std::cerr << "alt1 is " << alt1.expr << std::endl; )
    133141                                        if ( refToTuple(alt1.expr) ) {
     142                                                PRINT( std::cerr << "and is reference to tuple" << std::endl; )
    134143                                                if ( isMultAssign( begin, end ) ) {
     144                                                        PRINT( std::cerr << "possible multiple assignment" << std::endl; )
    135145                                                        matcher.reset( new MultipleAssignMatcher( *this, *ali ) );
    136146                                                } else {
    137147                                                        // mass assignment
     148                                                        PRINT( std::cerr << "possible mass assignment" << std::endl; )
    138149                                                        matcher.reset( new MassAssignMatcher( *this,  *ali ) );
    139150                                                }
     
    159170                // now resolve new assignments
    160171                for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
     172                        PRINT(
     173                                std::cerr << "== resolving tuple assign ==" << std::endl;
     174                                std::cerr << *i << std::endl;
     175                        )
     176
    161177                        ResolvExpr::AlternativeFinder finder( currentFinder.get_indexer(), currentFinder.get_environ() );
    162178                        try {
     
    248264                        ctorInit->accept( rm );
    249265                }
     266                PRINT( std::cerr << "new object: " << ret << std::endl; )
    250267                return ret;
    251268        }
Note: See TracChangeset for help on using the changeset viewer.