- File:
-
- 1 edited
-
src/ResolvExpr/AlternativeFinder.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
rda6032af rd97c3a4 474 474 } 475 475 476 // specialization cost of return types can't be accounted for directly, it disables 477 // otherwise-identical calls, like this example based on auto-newline in the I/O lib: 478 // 479 // forall(otype OS) { 480 // void ?|?(OS&, int); // with newline 481 // OS& ?|?(OS&, int); // no newline, always chosen due to more specialization 482 // } 476 // mark specialization cost of return types 477 for ( DeclarationWithType* returnVal : function->returnVals ) { 478 convCost.decSpec( specCost( returnVal->get_type() ) ); 479 } 483 480 484 481 // mark type variable and specialization cost of forall clause … … 486 483 for ( TypeDecl* td : function->forall ) { 487 484 convCost.decSpec( td->assertions.size() ); 485 } 486 487 // xxx -- replace with new costs in resolver 488 for ( InferredParams::const_iterator assert = appExpr->inferParams.begin(); assert != appExpr->inferParams.end(); ++assert ) { 489 convCost += computeConversionCost( assert->second.actualType, assert->second.formalType, indexer, alt.env ); 488 490 } 489 491 … … 1227 1229 Alternative newAlt{ 1228 1230 restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 1229 alt.env, openVars, needAssertions, alt.cost , alt.cost +thisCost };1231 alt.env, openVars, needAssertions, alt.cost + thisCost, thisCost }; 1230 1232 inferParameters( newAlt, back_inserter( candidates ) ); 1231 1233 } // if
Note:
See TracChangeset
for help on using the changeset viewer.