Changeset f5854507 for src/Tuples
- Timestamp:
- Oct 5, 2017, 11:53:12 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
rbb9d8e8 rf5854507 41 41 #include "SynTree/Visitor.h" // for Visitor 42 42 43 #if 0 44 #define PRINT(x) x 45 #else 46 #define PRINT(x) 47 #endif 48 43 49 namespace Tuples { 44 50 class TupleAssignSpotter { … … 119 125 if ( NameExpr *op = dynamic_cast< NameExpr * >(expr->get_function()) ) { 120 126 if ( CodeGen::isCtorDtorAssign( op->get_name() ) ) { 121 fname = op->get_name(); 127 fname = op->get_name(); 128 PRINT( std::cerr << "TupleAssignment: " << fname << std::endl; ) 122 129 for ( std::list<ResolvExpr::AltList>::const_iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) { 123 130 if ( ali->size() == 0 ) continue; // AlternativeFinder will natrually handle this case, if it's legal … … 131 138 const ResolvExpr::Alternative & alt1 = ali->front(); 132 139 auto begin = std::next(ali->begin(), 1), end = ali->end(); 140 PRINT( std::cerr << "alt1 is " << alt1.expr << std::endl; ) 133 141 if ( refToTuple(alt1.expr) ) { 142 PRINT( std::cerr << "and is reference to tuple" << std::endl; ) 134 143 if ( isMultAssign( begin, end ) ) { 144 PRINT( std::cerr << "possible multiple assignment" << std::endl; ) 135 145 matcher.reset( new MultipleAssignMatcher( *this, *ali ) ); 136 146 } else { 137 147 // mass assignment 148 PRINT( std::cerr << "possible mass assignment" << std::endl; ) 138 149 matcher.reset( new MassAssignMatcher( *this, *ali ) ); 139 150 } … … 159 170 // now resolve new assignments 160 171 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 161 177 ResolvExpr::AlternativeFinder finder( currentFinder.get_indexer(), currentFinder.get_environ() ); 162 178 try { … … 248 264 ctorInit->accept( rm ); 249 265 } 266 PRINT( std::cerr << "new object: " << ret << std::endl; ) 250 267 return ret; 251 268 }
Note: See TracChangeset
for help on using the changeset viewer.