Changeset eb0aedb for src/ResolvExpr/CastCost.cc
- Timestamp:
- Jan 10, 2018, 11:12:53 AM (7 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:
- 80e8582
- Parents:
- b8a4f47
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cc
rb8a4f47 reb0aedb 52 52 // all typedefs should be gone by this point 53 53 TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType ); 54 if ( type-> get_base()) {55 return castCost( src, type-> get_base(), indexer, env ) + Cost::safe;54 if ( type->base ) { 55 return castCost( src, type->base, indexer, env ) + Cost::safe; 56 56 } // if 57 57 } // if … … 105 105 void CastCost::visit( PointerType *pointerType ) { 106 106 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType-> get_base(), destAsPtr->get_base(), indexer, env ) ) {107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) { 108 108 cost = Cost::safe; 109 109 } else { 110 110 TypeEnvironment newEnv( env ); 111 newEnv.add( pointerType-> get_forall());112 newEnv.add( pointerType-> get_base()->get_forall());113 int castResult = ptrsCastable( pointerType-> get_base(), destAsPtr->get_base(), newEnv, indexer );111 newEnv.add( pointerType->forall ); 112 newEnv.add( pointerType->base->forall ); 113 int castResult = ptrsCastable( pointerType->base, destAsPtr->base, newEnv, indexer ); 114 114 if ( castResult > 0 ) { 115 115 cost = Cost::safe;
Note: See TracChangeset
for help on using the changeset viewer.