Changeset ba97ebf for src/ResolvExpr
- Timestamp:
- Apr 19, 2024, 5:29:53 PM (4 months ago)
- Branches:
- master
- Children:
- d7c0ad5
- Parents:
- fc1a3e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/PolyCost.cc
rfc1a3e2 rba97ebf 29 29 const ast::TypeEnvironment &env_; 30 30 31 PolyCost( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) 31 PolyCost( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) 32 32 : symtab( symtab ), result( 0 ), env_( env ) {} 33 33 34 34 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 ) { 36 36 if ( const ast::TypeInstType * otherType = eqv->bound.as< ast::TypeInstType >() ) { 37 37 if ( symtab.lookupType( otherType->name ) ) { 38 38 // Bound to opaque type. 39 result += 1;39 result = 1; 40 40 } 41 41 } else { 42 42 // Bound to concrete type. 43 result += 1;43 result = 1; 44 44 } 45 45 } … … 52 52 const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env 53 53 ) { 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 ); 57 55 } 58 56
Note: See TracChangeset
for help on using the changeset viewer.