Changes in src/GenPoly/Specialize.cc [906e24d:aedfd91]
- File:
-
- 1 edited
-
src/GenPoly/Specialize.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Specialize.cc
r906e24d raedfd91 147 147 148 148 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 ) ) { 151 151 FunctionType *funType; 152 152 if ( ( funType = getFunctionType( formalType ) ) ) { … … 171 171 void Specialize::handleExplicitParams( ApplicationExpr *appExpr ) { 172 172 // 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() ); 175 175 assert( function ); 176 176 std::list< DeclarationWithType* >::iterator formal; … … 200 200 Expression * Specialize::mutate( AddressExpr *addrExpr ) { 201 201 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() ) ); 204 204 return addrExpr; 205 205 } … … 207 207 Expression * Specialize::mutate( CastExpr *castExpr ) { 208 208 castExpr->get_arg()->acceptMutator( *this ); 209 if ( castExpr->get_result ()->isVoid() ) {209 if ( castExpr->get_results().empty() ) { 210 210 // can't specialize if we don't have a return value 211 211 return castExpr; 212 212 } 213 Expression *specialized = doSpecialization( castExpr->get_result (), castExpr->get_arg() );213 Expression *specialized = doSpecialization( castExpr->get_results().front(), castExpr->get_arg() ); 214 214 if ( specialized != castExpr->get_arg() ) { 215 215 // assume here that the specialization incorporates the cast
Note:
See TracChangeset
for help on using the changeset viewer.