Changeset 2fd9f24 for src


Ignore:
Timestamp:
Nov 16, 2018, 10:57:03 AM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
0b00df0
Parents:
fbecee5
Message:

IdChain? tweaks to resolver

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveAssertions.cc

    rfbecee5 r2fd9f24  
    189189                assertf( candidate->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() );
    190190
    191                 // everything with an empty idChain was pulled in by the current assertion.
    192                 // add current assertion's idChain + current assertion's ID so that the correct
    193                 // inferParameters can be found.
    194                 for ( auto& a : match.need ) {
    195                         if ( a.second.idChain.empty() ) {
    196                                 a.second.idChain = info.idChain;
    197                                 a.second.idChain.push_back( decl->get_uniqueId() );
    198                         }
    199                 }
    200 
    201191                Expression* varExpr = match.cdata.combine( alt.cvtCost );
    202192                delete varExpr->result;
     
    248238                        if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars,
    249239                                        resn.indexer ) ) {
     240                                // set up idChain on new assertions
     241                                for ( auto& a : newNeed ) {
     242                                        a.second.idChain = assn.info.idChain;
     243                                        a.second.idChain.push_back( assn.decl->get_uniqueId() );
     244                                }
     245
    250246                                matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have),
    251247                                        std::move(newNeed), std::move(newOpenVars) );
     
    316312                                                CandidateCost{resn.indexer} );
    317313                                       
    318                                         // for ( auto& compat : compatible ) {
    319314                                        for ( auto it = compatible.begin(); it != lmin ; ++it ) {
    320315                                                auto& compat = *it;
  • src/ResolvExpr/Resolver.cc

    rfbecee5 r2fd9f24  
    227227                                }
    228228
    229                                 winners.emplace_back( candidates[i] );
     229                                winners.emplace_back( std::move( candidates[i] ) );
    230230                        }
    231231
Note: See TracChangeset for help on using the changeset viewer.