Ignore:
Timestamp:
Dec 17, 2020, 4:18:23 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
089b1a9, f4f79dd
Parents:
c5a98f3 (diff), 68a867ee (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/CandidateFinder.cpp

    rc5a98f3 r41cde266  
    212212                // mark type variable and specialization cost of forall clause
    213213                convCost.incVar( function->forall.size() );
    214                 for ( const ast::TypeDecl * td : function->forall ) {
    215                         convCost.decSpec( td->assertions.size() );
    216                 }
     214                convCost.decSpec( function->assertions.size() );
    217215
    218216                return convCost;
     
    223221                ast::AssertionSet & need
    224222        ) {
    225                 for ( const ast::TypeDecl * tyvar : type->forall ) {
    226                         unifiableVars[ tyvar->name ] = ast::TypeDecl::Data{ tyvar };
    227                         for ( const ast::DeclWithType * assn : tyvar->assertions ) {
    228                                 need[ assn ].isUsed = true;
    229                         }
     223                for ( auto & tyvar : type->forall ) {
     224                        unifiableVars[ *tyvar ] = ast::TypeDecl::Data{ tyvar->base };
     225                }
     226                for ( auto & assn : type->assertions ) {
     227                        need[ assn ].isUsed = true;
    230228                }
    231229        }
     
    953951                                                auto inst = dynamic_cast< const ast::TypeInstType * >( funcResult )
    954952                                        ) {
    955                                                 if ( const ast::EqvClass * clz = func->env.lookup( inst->name ) ) {
     953                                                if ( const ast::EqvClass * clz = func->env.lookup( *inst ) ) {
    956954                                                        if ( auto function = clz->bound.as< ast::FunctionType >() ) {
    957955                                                                CandidateRef newFunc{ new Candidate{ *func } };
     
    10771075                        assert( toType );
    10781076                        toType = resolveTypeof( toType, symtab );
    1079                         toType = SymTab::validateType( castExpr->location, toType, symtab );
     1077                        // toType = SymTab::validateType( castExpr->location, toType, symtab );
    10801078                        toType = adjustExprType( toType, tenv, symtab );
    10811079
     
    11621160
    11631161                                        if(auto insttype = dynamic_cast<const ast::TypeInstType*>(expr)) {
    1164                                                 auto td = cand->env.lookup(insttype->name);
     1162                                                auto td = cand->env.lookup(*insttype);
    11651163                                                if(!td) { continue; }
    11661164                                                expr = td->bound.get();
     
    15681566                                // calculate target type
    15691567                                const ast::Type * toType = resolveTypeof( initAlt.type, symtab );
    1570                                 toType = SymTab::validateType( initExpr->location, toType, symtab );
     1568                                // toType = SymTab::validateType( initExpr->location, toType, symtab );
    15711569                                toType = adjustExprType( toType, tenv, symtab );
    15721570                                // The call to find must occur inside this loop, otherwise polymorphic return
Note: See TracChangeset for help on using the changeset viewer.