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