Changeset 22f94a4 for src/ResolvExpr/AlternativeFinder.cc
- Timestamp:
- Aug 11, 2020, 4:40:15 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0d070ca
- Parents:
- 07d867b (diff), 129674b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r07d867b r22f94a4 1216 1216 unify( castExpr->result, alt.expr->result, alt.env, needAssertions, 1217 1217 haveAssertions, openVars, indexer ); 1218 Cost thisCost = castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(), 1219 indexer, alt.env ); 1218 Cost thisCost = 1219 castExpr->isGenerated 1220 ? conversionCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(), indexer, alt.env ) 1221 : castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(), indexer, alt.env ); 1220 1222 PRINT( 1221 1223 std::cerr << "working on cast with result: " << castExpr->result << std::endl; … … 1698 1700 1699 1701 // unification run for side-effects 1700 unify( toType, alt.expr->result, newEnv, need, have, openVars, indexer ); 1702 bool canUnify = unify( toType, alt.expr->result, newEnv, need, have, openVars, indexer ); 1703 (void) canUnify; 1701 1704 // xxx - do some inspecting on this line... why isn't result bound to initAlt.type? 1702 1705 1703 Cost thisCost = c astCost( alt.expr->result, toType, alt.expr->get_lvalue(),1706 Cost thisCost = computeConversionCost( alt.expr->result, toType, alt.expr->get_lvalue(), 1704 1707 indexer, newEnv ); 1708 1709 PRINT( 1710 Cost legacyCost = castCost( alt.expr->result, toType, alt.expr->get_lvalue(), 1711 indexer, newEnv ); 1712 std::cerr << "Considering initialization:"; 1713 std::cerr << std::endl << " FROM: "; alt.expr->result->print(std::cerr); 1714 std::cerr << std::endl << " TO: "; toType ->print(std::cerr); 1715 std::cerr << std::endl << " Unification " << (canUnify ? "succeeded" : "failed"); 1716 std::cerr << std::endl << " Legacy cost " << legacyCost; 1717 std::cerr << std::endl << " New cost " << thisCost; 1718 std::cerr << std::endl; 1719 ) 1720 1705 1721 if ( thisCost != Cost::infinity ) { 1706 1722 // count one safe conversion for each value that is thrown away
Note: See TracChangeset
for help on using the changeset viewer.