Ignore:
Timestamp:
Apr 25, 2024, 3:48:17 PM (17 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
eb7586e
Parents:
cf191ac (diff), 55c97e4 (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:

resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/PolyCost.cc

    rcf191ac r7042c60  
    2929        const ast::TypeEnvironment &env_;
    3030
    31         PolyCost( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) 
     31        PolyCost( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env )
    3232        : symtab( symtab ), result( 0 ), env_( env ) {}
    3333
    3434        void previsit( const ast::TypeInstType * type ) {
    35                 if ( const ast::EqvClass * eqv = env_.lookup( *type ) ) /* && */ if ( eqv->bound ) {
     35                if ( const ast::EqvClass * eqv = env_.lookup( *type ) ; eqv && eqv->bound ) {
    3636                        if ( const ast::TypeInstType * otherType = eqv->bound.as< ast::TypeInstType >() ) {
    3737                                if ( symtab.lookupType( otherType->name ) ) {
    3838                                        // Bound to opaque type.
    39                                         result += 1;
     39                                        result = 1;
    4040                                }
    4141                        } else {
    4242                                // Bound to concrete type.
    43                                 result += 1;
     43                                result = 1;
    4444                        }
    4545                }
     
    5252        const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env
    5353) {
    54         ast::Pass<PolyCost> costing( symtab, env );
    55         type->accept( costing );
    56         return (costing.core.result > 0) ? 1 : 0;
     54        return ast::Pass<PolyCost>::read( type, symtab, env );
    5755}
    5856
Note: See TracChangeset for help on using the changeset viewer.