Ignore:
Timestamp:
Aug 15, 2019, 10:31:53 AM (6 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:
6daaee3
Parents:
d65f92c (diff), 3c7f01b (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' into distcc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    rd65f92c r5c4a473  
    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.
     
    11861188                assert( toType );
    11871189                toType = resolveTypeof( toType, indexer );
     1190                assert(!dynamic_cast<TypeofType *>(toType));
    11881191                SymTab::validateType( toType, &indexer );
    11891192                adjustExprType( toType, env, indexer );
     
    12121215                        unify( castExpr->result, alt.expr->result, alt.env, needAssertions,
    12131216                                haveAssertions, openVars, indexer );
    1214                         Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer,
    1215                                 alt.env );
     1217                        Cost thisCost = castCost( alt.expr->result, castExpr->result, alt.expr->get_lvalue(),
     1218                                indexer, alt.env );
    12161219                        PRINT(
    12171220                                std::cerr << "working on cast with result: " << castExpr->result << std::endl;
     
    16401643                                // xxx - do some inspecting on this line... why isn't result bound to initAlt.type?
    16411644
    1642                                 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv );
     1645                                Cost thisCost = castCost( alt.expr->result, toType, alt.expr->get_lvalue(),
     1646                                        indexer, newEnv );
    16431647                                if ( thisCost != Cost::infinity ) {
    16441648                                        // count one safe conversion for each value that is thrown away
Note: See TracChangeset for help on using the changeset viewer.