Changeset d9fa60a for src/SymTab


Ignore:
Timestamp:
Nov 16, 2016, 4:37:50 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:
186fd86
Parents:
33a7b6d
Message:

moved substituion into MemberExpr? constructor, change generated tuple structs to generic structs, tuples containing type variables almost works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r33a7b6d rd9fa60a  
    175175
    176176        void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, TypeSubstitution & genericSubs, bool isDynamicLayout, bool forward = true ) {
    177 //              if ( isDynamicLayout && src ) {
    178 //                      genericSubs.apply( src );
    179 //              }
    180 
    181177                ObjectDecl * returnVal = NULL;
    182178                if ( ! func->get_functionType()->get_returnVals().empty() ) {
     
    187183
    188184                // assign to destination (and return value if generic)
    189                 UntypedExpr *derefExpr = new UntypedExpr( new NameExpr( "*?" ) );
    190                 derefExpr->get_args().push_back( new VariableExpr( dstParam ) );
     185                UntypedExpr *derefExpr = UntypedExpr::createDeref( new VariableExpr( dstParam ) );
    191186                Expression *dstselect = new MemberExpr( field, derefExpr );
    192187                genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    193188
    194189                if ( isDynamicLayout && returnVal ) {
    195                         UntypedExpr *derefRet = new UntypedExpr( new NameExpr( "*?" ) );
    196                         derefRet->get_args().push_back( new VariableExpr( returnVal ) );
    197                         Expression *retselect = new MemberExpr( field, derefRet );
     190                        // xxx - there used to be a dereference on returnVal, but this seems to have been wrong?
     191                        Expression *retselect = new MemberExpr( field, new VariableExpr( returnVal ) );
    198192                        genImplicitCall( srcParam, retselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    199193                } // if
Note: See TracChangeset for help on using the changeset viewer.