Ignore:
Timestamp:
Jul 17, 2017, 3:25:58 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
795d450
Parents:
7ebaa56
Message:

Fix TupleAssignment? code for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/Explode.h

    r7ebaa56 re6cee92  
    2727
    2828namespace Tuples {
    29         /// helper function used by explode to properly distribute
    30         /// '&' across a tuple expression
    31         Expression * distributeAddr( Expression * expr );
    32 
    3329        /// helper function used by explode
    3430        template< typename OutputIterator >
    3531        void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, const SymTab::Indexer & indexer, OutputIterator out, bool isTupleAssign ) {
    36                 if ( isTupleAssign ) {
    37                         // tuple assignment needs AddressExprs to be recursively exploded to easily get at all of the components
    38                         if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) {
    39                                 ResolvExpr::AltList alts;
    40                                 explodeUnique( addrExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign );
    41                                 for ( ResolvExpr::Alternative & alt : alts ) {
    42                                         // distribute '&' over all components
    43                                         alt.expr = distributeAddr( alt.expr );
    44                                         *out++ = alt;
    45                                 }
    46                                 // in tuple assignment, still need to handle the other cases, but only if not already handled here (don't want to output too many alternatives)
    47                                 return;
    48                         }
    49                 }
    5032                Type * res = expr->get_result();
    5133                if ( TupleType * tupleType = dynamic_cast< TupleType * > ( res ) ) {
Note: See TracChangeset for help on using the changeset viewer.