Changeset 150ec33 for src/ResolvExpr/ConversionCost.cc
- Timestamp:
- Oct 19, 2017, 11:15:35 AM (6 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:
- f232977
- Parents:
- d411426d
- git-author:
- Rob Schluntz <rschlunt@…> (10/13/17 16:03:35)
- git-committer:
- Rob Schluntz <rschlunt@…> (10/19/17 11:15:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
rd411426d r150ec33 306 306 // recursively compute conversion cost from T1 to T2. 307 307 // cv can be safely dropped because of 'implicit dereference' behavior. 308 refType-> get_base()->accept( *this );309 if ( refType-> get_base()->get_qualifiers() == dest->get_qualifiers() ) {308 refType->base->accept( *this ); 309 if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) { 310 310 cost.incReference(); // prefer exact qualifiers 311 } else if ( refType-> get_base()->get_qualifiers() < dest->get_qualifiers() ) {311 } else if ( refType->base->get_qualifiers() < dest->get_qualifiers() ) { 312 312 cost.incSafe(); // then gaining qualifiers 313 313 } else { … … 321 321 void ConversionCost::visit(StructInstType *inst) { 322 322 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 323 if ( inst-> get_name() == destAsInst->get_name()) {323 if ( inst->name == destAsInst->name ) { 324 324 cost = Cost::zero; 325 325 } // if … … 328 328 329 329 void ConversionCost::visit(UnionInstType *inst) { 330 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {331 if ( inst-> get_name() == destAsInst->get_name()) {330 if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) { 331 if ( inst->name == destAsInst->name ) { 332 332 cost = Cost::zero; 333 333 } // if
Note: See TracChangeset
for help on using the changeset viewer.