- File:
-
- 1 edited
-
src/ResolvExpr/AlternativeFinder.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
rcc4218f r7d01cf44 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sat May 16 23:52:08 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 25 22:37:46201913 // Update Count : 3 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Thu Aug 8 16:35:00 2019 13 // Update Count : 38 14 14 // 15 15 … … 377 377 } 378 378 379 Cost computeConversionCost( Type * actualType, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 379 Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue, 380 const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 380 381 PRINT( 381 382 std::cerr << std::endl << "converting "; … … 387 388 std::cerr << std::endl; 388 389 ) 389 Cost convCost = conversionCost( actualType, formalType, indexer, env );390 Cost convCost = conversionCost( actualType, formalType, actualIsLvalue, indexer, env ); 390 391 PRINT( 391 392 std::cerr << std::endl << "cost is " << convCost << std::endl; … … 402 403 403 404 Cost computeExpressionConversionCost( Expression *& actualExpr, Type * formalType, const SymTab::Indexer &indexer, const TypeEnvironment & env ) { 404 Cost convCost = computeConversionCost( actualExpr->result, formalType, indexer, env ); 405 Cost convCost = computeConversionCost( 406 actualExpr->result, formalType, actualExpr->get_lvalue(), indexer, env ); 405 407 406 408 // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion. … … 1135 1137 bool isLvalue( Expression *expr ) { 1136 1138 // xxx - recurse into tuples? 1137 return expr->result && ( expr-> result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );1139 return expr->result && ( expr->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) ); 1138 1140 } 1139 1141 … … 1186 1188 assert( toType ); 1187 1189 toType = resolveTypeof( toType, indexer ); 1188 assert(!dynamic_cast<TypeofType *>(toType));1189 1190 SymTab::validateType( toType, &indexer ); 1190 1191 adjustExprType( toType, env, indexer ); … … 1213 1214 unify( castExpr->result, alt.expr->result, alt.env, needAssertions, 1214 1215 haveAssertions, openVars, indexer ); 1215 Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer,1216 alt.env );1216 Cost thisCost = castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(), 1217 indexer, alt.env ); 1217 1218 PRINT( 1218 1219 std::cerr << "working on cast with result: " << castExpr->result << std::endl; … … 1641 1642 // xxx - do some inspecting on this line... why isn't result bound to initAlt.type? 1642 1643 1643 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv ); 1644 Cost thisCost = castCost( alt.expr->result, toType, alt.expr->get_lvalue(), 1645 indexer, newEnv ); 1644 1646 if ( thisCost != Cost::infinity ) { 1645 1647 // count one safe conversion for each value that is thrown away
Note:
See TracChangeset
for help on using the changeset viewer.