Ignore:
Timestamp:
Nov 9, 2016, 2:05:09 PM (8 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:
23bb1b9
Parents:
8780e30
Message:

refactor some code that generates dereference and assignment calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r8780e30 rb3b2077  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 15:02:53 2015
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Nov 9 13:48:42 2016
    1313// Update Count     : 2
    1414//
     
    180180                // explode the lhs so that each field of the tuple-valued-expr is assigned.
    181181                explode( lhsAlt, spotter.currentFinder.get_indexer(), back_inserter(lhs) );
     182
    182183                // and finally, re-add the cast to each lhs expr, so that qualified tuple fields can be constructed
    183184                if ( isCast ) {
     
    192193                        }
    193194                }
    194                 // }
    195         }
    196 
    197         TupleAssignSpotter::MassAssignMatcher::MassAssignMatcher( TupleAssignSpotter &spotter,const ResolvExpr::AltList & alts ) : Matcher( spotter, alts ) {
     195        }
     196
     197        TupleAssignSpotter::MassAssignMatcher::MassAssignMatcher( TupleAssignSpotter &spotter, const ResolvExpr::AltList & alts ) : Matcher( spotter, alts ) {
    198198                assert( alts.size() == 1 || alts.size() == 2 );
    199199                if ( alts.size() == 2 ) {
     
    210210                assert( left );
    211211                std::list< Expression * > args;
    212                 args.push_back( new AddressExpr( new UntypedExpr( new NameExpr("*?"), std::list< Expression * >{ new VariableExpr( left ) } ) ) );
     212                args.push_back( new AddressExpr( UntypedExpr::createDeref( new VariableExpr( left ) ) ) );
    213213                // args.push_back( new AddressExpr( new VariableExpr( left ) ) );
    214214                if ( right ) args.push_back( new VariableExpr( right ) );
     
    238238                static UniqueName lhsNamer( "__multassign_L" );
    239239                static UniqueName rhsNamer( "__multassign_R" );
     240
    240241                // xxx - need more complicated matching?
    241242                if ( lhs.size() == rhs.size() ) {
Note: See TracChangeset for help on using the changeset viewer.