Changeset 982f95d for src/ResolvExpr/CastCost.cc
- Timestamp:
- Jun 15, 2018, 5:09:29 PM (6 years ago)
- Branches:
- new-env
- Children:
- 97397a26
- Parents:
- 1d7b0a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cc
r1d7b0a8 r982f95d 18 18 #include "ConversionCost.h" // for ConversionCost 19 19 #include "Cost.h" // for Cost, Cost::infinity 20 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment, EqvClass20 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment, ClassRef 21 21 #include "SymTab/Indexer.h" // for Indexer 22 22 #include "SynTree/Declaration.h" // for TypeDecl, NamedTypeDecl … … 43 43 Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 44 44 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 45 if ( const EqvClass*eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {46 if ( eqvClass->type ) {47 return castCost( src, eqvClass->type, indexer, env );45 if ( ClassRef eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 46 if ( Type* boundTy = eqvClass.get_bound().type ) { 47 return castCost( src, boundTy, indexer, env ); 48 48 } else { 49 49 return Cost::infinity;
Note: See TracChangeset
for help on using the changeset viewer.