Ignore:
Timestamp:
Aug 13, 2019, 2:36:06 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dcfedca
Parents:
dee1f89 (diff), 14388c1 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    rdee1f89 r1118b8b  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 23:52:08 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:37:46 2019
    13 // Update Count     : 37
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thu Aug  8 16:35:00 2019
     13// Update Count     : 38
    1414//
    1515
     
    377377        }
    378378
    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 ) {
    380381                PRINT(
    381382                        std::cerr << std::endl << "converting ";
     
    387388                        std::cerr << std::endl;
    388389                )
    389                 Cost convCost = conversionCost( actualType, formalType, indexer, env );
     390                Cost convCost = conversionCost( actualType, formalType, actualIsLvalue, indexer, env );
    390391                PRINT(
    391392                        std::cerr << std::endl << "cost is " << convCost << std::endl;
     
    402403
    403404        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 );
    405407
    406408                // if there is a non-zero conversion cost, ignoring poly cost, then the expression requires conversion.
     
    12131215                        unify( castExpr->result, alt.expr->result, alt.env, needAssertions,
    12141216                                haveAssertions, openVars, indexer );
    1215                         Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer,
    1216                                 alt.env );
     1217                        Cost thisCost = castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(),
     1218                                indexer, alt.env );
    12171219                        PRINT(
    12181220                                std::cerr << "working on cast with result: " << castExpr->result << std::endl;
     
    16411643                                // xxx - do some inspecting on this line... why isn't result bound to initAlt.type?
    16421644
    1643                                 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv );
     1645                                Cost thisCost = castCost( alt.expr->result, toType, alt.expr->get_lvalue(),
     1646                                        indexer, newEnv );
    16441647                                if ( thisCost != Cost::infinity ) {
    16451648                                        // count one safe conversion for each value that is thrown away
Note: See TracChangeset for help on using the changeset viewer.