Changeset e67a82d for src/Tuples/TupleAssignment.cc
- Timestamp:
- Aug 20, 2020, 11:48:15 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d685cb0
- Parents:
- 67ca73e (diff), 013b028 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
r67ca73e re67a82d 465 465 // resolve ctor/dtor for the new object 466 466 ast::ptr< ast::Init > ctorInit = ResolvExpr::resolveCtorInit( 467 InitTweak::genCtorInit( location, ret ), spotter.crntFinder. symtab);467 InitTweak::genCtorInit( location, ret ), spotter.crntFinder.localSyms ); 468 468 // remove environments from subexpressions of stmtExpr 469 469 ast::Pass< EnvRemover > rm{ env }; … … 504 504 505 505 std::vector< ast::ptr< ast::Expr > > match() override { 506 static UniqueName lhsNamer( "__massassign_L" ); 507 static UniqueName rhsNamer( "__massassign_R" ); 506 // temporary workaround for new and old ast to coexist and avoid name collision 507 static UniqueName lhsNamer( "__massassign_Ln" ); 508 static UniqueName rhsNamer( "__massassign_Rn" ); 508 509 // empty tuple case falls into this matcher 509 510 assert( lhs.empty() ? rhs.empty() : rhs.size() <= 1 ); … … 534 535 535 536 std::vector< ast::ptr< ast::Expr > > match() override { 536 static UniqueName lhsNamer( "__multassign_L" ); 537 static UniqueName rhsNamer( "__multassign_R" ); 537 // temporary workaround for new and old ast to coexist and avoid name collision 538 static UniqueName lhsNamer( "__multassign_Ln" ); 539 static UniqueName rhsNamer( "__multassign_Rn" ); 538 540 539 541 if ( lhs.size() != rhs.size() ) return {}; … … 560 562 // resolve the cast expression so that rhsCand return type is bound by the cast 561 563 // type as needed, and transfer the resulting environment 562 ResolvExpr::CandidateFinder finder{ spotter.crntFinder. symtab, env };564 ResolvExpr::CandidateFinder finder{ spotter.crntFinder.localSyms, env }; 563 565 finder.find( rhsCand->expr, ResolvExpr::ResolvMode::withAdjustment() ); 564 566 assert( finder.candidates.size() == 1 ); … … 609 611 // explode the LHS so that each field of a tuple-valued expr is assigned 610 612 ResolvExpr::CandidateList lhs; 611 explode( *lhsCand, crntFinder. symtab, back_inserter(lhs), true );613 explode( *lhsCand, crntFinder.localSyms, back_inserter(lhs), true ); 612 614 for ( ResolvExpr::CandidateRef & cand : lhs ) { 613 615 // each LHS value must be a reference - some come in with a cast, if not … … 629 631 if ( isTuple( rhsCand->expr ) ) { 630 632 // multiple assignment 631 explode( *rhsCand, crntFinder. symtab, back_inserter(rhs), true );633 explode( *rhsCand, crntFinder.localSyms, back_inserter(rhs), true ); 632 634 matcher.reset( 633 635 new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } ); … … 648 650 // multiple assignment 649 651 ResolvExpr::CandidateList rhs; 650 explode( rhsCand, crntFinder. symtab, back_inserter(rhs), true );652 explode( rhsCand, crntFinder.localSyms, back_inserter(rhs), true ); 651 653 matcher.reset( 652 654 new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } ); … … 678 680 ) 679 681 680 ResolvExpr::CandidateFinder finder{ crntFinder. symtab, matcher->env };682 ResolvExpr::CandidateFinder finder{ crntFinder.localSyms, matcher->env }; 681 683 682 684 try {
Note:
See TracChangeset
for help on using the changeset viewer.