Changeset b8b075cd
- Timestamp:
- Dec 18, 2017, 2:27:47 PM (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:
- fb57626
- Parents:
- 7641b6c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
r7641b6c rb8b075cd 292 292 cost = Cost::safe; 293 293 } 294 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?294 } else { 295 295 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); 296 296 PRINT( std::cerr << " :: " << assignResult << std::endl; ) 297 if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 298 cost = Cost::safe; 297 if ( assignResult > 0 && tq1 <= tq2 ) { 298 // xxx - want the case where qualifiers are added to be more expensive than the case where qualifiers are the same. Is 1 safe vs. 2 safe correct? 299 if ( tq1 == tq2 ) { 300 cost = Cost::safe; 301 } else if ( tq1 < tq2 ) { 302 cost = Cost::safe+Cost::safe; 303 } 299 304 } else if ( assignResult < 0 ) { 300 305 cost = Cost::unsafe;
Note: See TracChangeset
for help on using the changeset viewer.