Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r7d01cf44 rcc4218f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 23:52:08 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thu Aug  8 16:35:00 2019
    13 // Update Count     : 38
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 25 22:37:46 2019
     13// Update Count     : 37
    1414//
    1515
     
    377377        }
    378378
    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 ) {
    381380                PRINT(
    382381                        std::cerr << std::endl << "converting ";
     
    388387                        std::cerr << std::endl;
    389388                )
    390                 Cost convCost = conversionCost( actualType, formalType, actualIsLvalue, indexer, env );
     389                Cost convCost = conversionCost( actualType, formalType, indexer, env );
    391390                PRINT(
    392391                        std::cerr << std::endl << "cost is " << convCost << std::endl;
     
    403402
    404403        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 );
    407405
    408406                // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion.
     
    11371135        bool isLvalue( Expression *expr ) {
    11381136                // 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 ) );
    11401138        }
    11411139
     
    11881186                assert( toType );
    11891187                toType = resolveTypeof( toType, indexer );
     1188                assert(!dynamic_cast<TypeofType *>(toType));
    11901189                SymTab::validateType( toType, &indexer );
    11911190                adjustExprType( toType, env, indexer );
     
    12141213                        unify( castExpr->result, alt.expr->result, alt.env, needAssertions,
    12151214                                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 );
    12181217                        PRINT(
    12191218                                std::cerr << "working on cast with result: " << castExpr->result << std::endl;
     
    16421641                                // xxx - do some inspecting on this line... why isn't result bound to initAlt.type?
    16431642
    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 );
    16461644                                if ( thisCost != Cost::infinity ) {
    16471645                                        // count one safe conversion for each value that is thrown away
Note: See TracChangeset for help on using the changeset viewer.