Changeset 54043f4


Ignore:
Timestamp:
Feb 27, 2018, 4:52:10 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
86e84e4
Parents:
eddb399
Message:

Add with expression cost into conversion cost

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    reddb399 r54043f4  
    567567                                //if ( newNeedParents[ curDecl->get_uniqueId() ][ candDecl->get_uniqueId() ]++ > recursionParentLimit ) continue;
    568568
    569                                 Expression *varExpr = data.combine( newerAlt.cost );
     569                                Expression *varExpr = data.combine( newerAlt.cvtCost );
    570570                                delete varExpr->get_result();
    571571                                varExpr->set_result( adjType->clone() );
     
    13731373                        Cost cost = Cost::zero;
    13741374                        Expression * newExpr = data.combine( cost );
    1375                         alternatives.push_back( Alternative( newExpr, env, Cost::zero ) ); // xxx
     1375                        alternatives.push_back( Alternative( newExpr, env, Cost::zero, cost ) );
    13761376                        PRINT(
    13771377                                std::cerr << "decl is ";
     
    14881488                                Cost cost = Cost::zero;
    14891489                                Expression * newExpr = data.combine( cost );
    1490                                 alternatives.push_back( Alternative( new AttrExpr( newExpr, argType->clone() ), env, cost ) );
     1490                                alternatives.push_back( Alternative( new AttrExpr( newExpr, argType->clone() ), env, Cost::zero, cost ) );
    14911491                                for ( DeclarationWithType * retVal : function->returnVals ) {
    14921492                                        alternatives.back().expr->result = retVal->get_type()->clone();
     
    15271527                                Cost cost = Cost::zero;
    15281528                                Expression * newExpr = data.combine( cost );
    1529                                 alternatives.push_back( Alternative( newExpr, env, cost ) );
     1529                                alternatives.push_back( Alternative( newExpr, env, Cost::zero, cost ) );
    15301530                                renameTypes( alternatives.back().expr );
    15311531                        } // for
Note: See TracChangeset for help on using the changeset viewer.