Ignore:
Timestamp:
Feb 22, 2019, 10:43:29 AM (5 years ago)
Author:
tdelisle <tdelisle@…>
Branches:
no_list
Parents:
43e0949
Message:

Parameters and return value of functions are now vectors (and some related clean-up)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cc

    r43e0949 r2f42718  
    9191                if ( tuple1 && tuple2 ) {
    9292                        if ( tuple1->size() != tuple2->size() ) return false;
    93                         for ( auto types : group_iterate( tuple1->get_types(), tuple2->get_types() ) ) {
     93                        for ( auto types : group_iterate( tuple1->types, tuple2->types ) ) {
    9494                                if ( ! matchingTupleStructure( std::get<0>( types ), std::get<1>( types ) ) ) return false;
    9595                        }
     
    115115        size_t functionParameterSize( FunctionType * ftype ) {
    116116                size_t sz = 0;
    117                 for ( DeclarationWithType * p : ftype->get_parameters() ) {
     117                for ( DeclarationWithType * p : ftype->parameters ) {
    118118                        sz += singleParameterSize( p->get_type() );
    119119                }
     
    227227                }
    228228                std::unique_ptr< FunctionType > actualTypeManager( actualType ); // for RAII
    229                 std::list< DeclarationWithType * >::iterator actualBegin = actualType->get_parameters().begin();
    230                 std::list< DeclarationWithType * >::iterator actualEnd = actualType->get_parameters().end();
     229                auto actualBegin = actualType->parameters.begin();
     230                auto actualEnd   = actualType->parameters.end();
    231231
    232232                std::list< Expression * > args;
    233                 for ( DeclarationWithType* param : thunkFunc->get_functionType()->get_parameters() ) {
     233                for ( DeclarationWithType* param : thunkFunc->get_functionType()->parameters ) {
    234234                        // name each thunk parameter and explode it - these are then threaded back into the actual function call.
    235235                        param->set_name( paramNamer.newName() );
     
    281281                FunctionType *function = getFunctionType( appExpr->function->result );
    282282                assert( function );
    283                 std::list< DeclarationWithType* >::iterator formal;
     283                std::vector< DeclarationWithType* >::iterator formal;
    284284                std::list< Expression* >::iterator actual;
    285                 for ( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) {
     285                for ( formal = function->parameters.begin(), actual = appExpr->get_args().begin(); formal != function->parameters.end() && actual != appExpr->get_args().end(); ++formal, ++actual ) {
    286286                        *actual = doSpecialization( (*formal)->get_type(), *actual, &appExpr->inferParams );
    287287                }
Note: See TracChangeset for help on using the changeset viewer.