Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cc

    r906e24d raedfd91  
    147147
    148148        Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) {
    149                 assert( actual->has_result() );
    150                 if ( needsSpecialization( formalType, actual->get_result(), env ) ) {
     149                assert( ! actual->get_results().empty() ); // using front, should have this assert
     150                if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) {
    151151                        FunctionType *funType;
    152152                        if ( ( funType = getFunctionType( formalType ) ) ) {
     
    171171        void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) {
    172172                // create thunks for the explicit parameters
    173                 assert( appExpr->get_function()->has_result() );
    174                 FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );
     173                assert( ! appExpr->get_function()->get_results().empty() );
     174                FunctionType *function = getFunctionType( appExpr->get_function()->get_results().front() );
    175175                assert( function );
    176176                std::list< DeclarationWithType* >::iterator formal;
     
    200200        Expression * Specialize::mutate( AddressExpr *addrExpr ) {
    201201                addrExpr->get_arg()->acceptMutator( *this );
    202                 assert( addrExpr->has_result() );
    203                 addrExpr->set_arg( doSpecialization( addrExpr->get_result(), addrExpr->get_arg() ) );
     202                assert( ! addrExpr->get_results().empty() );
     203                addrExpr->set_arg( doSpecialization( addrExpr->get_results().front(), addrExpr->get_arg() ) );
    204204                return addrExpr;
    205205        }
     
    207207        Expression * Specialize::mutate( CastExpr *castExpr ) {
    208208                castExpr->get_arg()->acceptMutator( *this );
    209                 if ( castExpr->get_result()->isVoid() ) {
     209                if ( castExpr->get_results().empty() ) {
    210210                        // can't specialize if we don't have a return value
    211211                        return castExpr;
    212212                }
    213                 Expression *specialized = doSpecialization( castExpr->get_result(), castExpr->get_arg() );
     213                Expression *specialized = doSpecialization( castExpr->get_results().front(), castExpr->get_arg() );
    214214                if ( specialized != castExpr->get_arg() ) {
    215215                        // assume here that the specialization incorporates the cast
Note: See TracChangeset for help on using the changeset viewer.