Changeset 1521de20
- Timestamp:
- Oct 7, 2015, 12:40:53 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 9909842, f28a53a
- Parents:
- 1cbca6e
- Location:
- src/ResolvExpr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ResolvExpr/CastCost.cc ¶
r1cbca6e r1521de20 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 06:57:43 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 06:59:10201513 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Oct 05 14:48:45 2015 13 // Update Count : 5 14 14 // 15 15 … … 56 56 return Cost::infinity; 57 57 } else { 58 // xxx - why are we adding cost 0 here? 58 59 return converter.get_cost() + Cost( 0, 0, 0 ); 59 60 } // if … … 82 83 newEnv.add( pointerType->get_forall() ); 83 84 newEnv.add( pointerType->get_base()->get_forall() ); 84 int assignResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer );85 if ( assignResult > 0 ) {85 int castResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer ); 86 if ( castResult > 0 ) { 86 87 cost = Cost( 0, 0, 1 ); 87 } else if ( assignResult < 0 ) {88 } else if ( castResult < 0 ) { 88 89 cost = Cost( 1, 0, 0 ); 89 90 } // if -
TabularUnified src/ResolvExpr/PtrsAssignable.cc ¶
r1cbca6e r1521de20 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 11:44:11 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 11:47:36201513 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Sep 21 14:34:58 2015 13 // Update Count : 7 14 14 // 15 15 … … 106 106 void PtrsAssignable::visit( TypeInstType *inst ) { 107 107 EqvClass eqvClass; 108 if ( env.lookup( inst->get_name(), eqvClass ) ) {108 if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) { 109 109 result = ptrsAssignable( eqvClass.type, dest, env ); 110 110 } else { -
TabularUnified src/ResolvExpr/PtrsCastable.cc ¶
r1cbca6e r1521de20 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 11:48:00 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 11:51:17201513 // Update Count : 211 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Oct 05 14:49:12 2015 13 // Update Count : 7 14 14 // 15 15 … … 133 133 134 134 void PtrsCastable::visit(TypeInstType *inst) { 135 result = objectCast( inst, env, indexer ) && objectCast( dest, env, indexer )? 1 : -1;135 result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1; 136 136 } 137 137
Note: See TracChangeset
for help on using the changeset viewer.