Changeset 3f7e12cb for src/ResolvExpr/PolyCost.cc
- Timestamp:
- Nov 8, 2017, 5:43:33 PM (8 years ago)
- 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:
- 954908d
- Parents:
- 78315272 (diff), e35f30a (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/PolyCost.cc
r78315272 r3f7e12cb 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // PolyCost.cc -- 7 // PolyCost.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 31 31 }; 32 32 33 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) {33 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) { 34 34 PolyCost coster( env, indexer ); 35 35 type->accept( coster ); … … 37 37 } 38 38 39 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer &indexer ) : result( 0 ), env( env ), indexer( indexer ) {39 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), env( env ), indexer( indexer ) { 40 40 } 41 41 42 void PolyCost::visit(TypeInstType * typeInst) {42 void PolyCost::visit(TypeInstType * typeInst) { 43 43 EqvClass eqvClass; 44 if ( env.lookup( typeInst-> get_name(), eqvClass ) ) {44 if ( env.lookup( typeInst->name, eqvClass ) ) { 45 45 if ( eqvClass.type ) { 46 if ( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->get_name() ) ) { 46 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 47 if ( indexer.lookupType( otherTypeInst->name ) ) { 48 // bound to opaque type 48 49 result += 1; 49 50 } // if 50 51 } else { 52 // bound to concrete type 51 53 result += 1; 52 54 } // if
Note:
See TracChangeset
for help on using the changeset viewer.