- File:
-
- 1 edited
-
src/ResolvExpr/CandidateFinder.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
rb69233ac r17a0ede2 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 & env71 ) {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 93 68 namespace { 94 69 /// First index is which argument, second is which alternative, third is which exploded element … … 109 84 } 110 85 return out; 86 } 87 88 /// Computes conversion cost between two types 89 Cost computeConversionCost( 90 const ast::Type * argType, const ast::Type * paramType, const ast::SymbolTable & symtab, 91 const ast::TypeEnvironment & env 92 ) { 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; 111 112 } 112 113 … … 1563 1564 CandidateList satisfied; 1564 1565 std::vector< std::string > errors; 1565 for ( CandidateRef& candidate : candidates ) {1566 satisfyAssertions( candidate, symtab, satisfied, errors );1566 for ( auto & candidate : candidates ) { 1567 satisfyAssertions( *candidate, symtab, satisfied, errors ); 1567 1568 } 1568 1569
Note:
See TracChangeset
for help on using the changeset viewer.