Changeset 5b51f5e for src/Tuples


Ignore:
Timestamp:
Jan 5, 2018, 3:21:42 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, stuck-waitfor-destruct, with_gc
Children:
65deb18, cae28da
Parents:
5c4f2c2 (diff), b834e98 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/Tuples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r5c4f2c2 r5b51f5e  
    272272                // args.push_back( new AddressExpr( new VariableExpr( left ) ) );
    273273                if ( right ) args.push_back( new VariableExpr( right ) );
    274                 return new UntypedExpr( new NameExpr( fname ), args );
     274                if ( left->type->referenceDepth() > 1 && CodeGen::isConstructor( fname ) ) {
     275                        args.front() = new AddressExpr( args.front() );
     276                        if ( right ) args.back() = new AddressExpr( args.back() );
     277                        return new UntypedExpr( new NameExpr( "?=?" ), args );
     278                } else {
     279                        return new UntypedExpr( new NameExpr( fname ), args );
     280                }
    275281        }
    276282
     
    291297                if ( ! dynamic_cast< ReferenceType * >( expr->get_result() ) ) {
    292298                        ConstructorInit * ctorInit = InitTweak::genCtorInit( ret );
    293                         ret->set_init( ctorInit );
     299                        ret->init = ctorInit;
    294300                        ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
    295301                        PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs
  • src/Tuples/TupleExpansion.cc

    r5c4f2c2 r5b51f5e  
    202202                        // generate struct type to replace tuple type based on the number of components in the tuple
    203203                        StructDecl * decl = new StructDecl( toString( "_tuple", tupleSize, "_" ) );
     204                        decl->location = tupleType->location;
    204205                        decl->set_body( true );
    205206                        for ( size_t i = 0; i < tupleSize; ++i ) {
Note: See TracChangeset for help on using the changeset viewer.