- File:
-
- 1 edited
-
src/ResolvExpr/CandidateFinder.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r17a0ede2 rb69233ac 66 66 UniqueId globalResnSlot = 0; 67 67 68 Cost computeConversionCost( 69 const ast::Type * argType, const ast::Type * paramType, const ast::SymbolTable & symtab, 70 const ast::TypeEnvironment & env 71 ) { 72 PRINT( 73 std::cerr << std::endl << "converting "; 74 ast::print( std::cerr, argType, 2 ); 75 std::cerr << std::endl << " to "; 76 ast::print( std::cerr, paramType, 2 ); 77 std::cerr << std::endl << "environment is: "; 78 ast::print( std::cerr, env, 2 ); 79 std::cerr << std::endl; 80 ) 81 Cost convCost = conversionCost( argType, paramType, symtab, env ); 82 PRINT( 83 std::cerr << std::endl << "cost is " << convCost << std::endl; 84 ) 85 if ( convCost == Cost::infinity ) return convCost; 86 convCost.incPoly( polyCost( paramType, symtab, env ) + polyCost( argType, symtab, env ) ); 87 PRINT( 88 std::cerr << "cost with polycost is " << convCost << std::endl; 89 ) 90 return convCost; 91 } 92 68 93 namespace { 69 94 /// First index is which argument, second is which alternative, third is which exploded element … … 84 109 } 85 110 return out; 86 }87 88 /// Computes conversion cost between two types89 Cost computeConversionCost(90 const ast::Type * argType, const ast::Type * paramType, const ast::SymbolTable & symtab,91 const ast::TypeEnvironment & env92 ) {93 PRINT(94 std::cerr << std::endl << "converting ";95 ast::print( std::cerr, argType, 2 );96 std::cerr << std::endl << " to ";97 ast::print( std::cerr, paramType, 2 );98 std::cerr << std::endl << "environment is: ";99 ast::print( std::cerr, env, 2 );100 std::cerr << std::endl;101 )102 Cost convCost = conversionCost( argType, paramType, symtab, env );103 PRINT(104 std::cerr << std::endl << "cost is " << convCost << std::endl;105 )106 if ( convCost == Cost::infinity ) return convCost;107 convCost.incPoly( polyCost( paramType, symtab, env ) + polyCost( argType, symtab, env ) );108 PRINT(109 std::cerr << "cost with polycost is " << convCost << std::endl;110 )111 return convCost;112 111 } 113 112 … … 1564 1563 CandidateList satisfied; 1565 1564 std::vector< std::string > errors; 1566 for ( auto& candidate : candidates ) {1567 satisfyAssertions( *candidate, symtab, satisfied, errors );1565 for ( CandidateRef & candidate : candidates ) { 1566 satisfyAssertions( candidate, symtab, satisfied, errors ); 1568 1567 } 1569 1568
Note:
See TracChangeset
for help on using the changeset viewer.