Changeset bbf2cb1 for src/ResolvExpr/ConversionCost.cc
- Timestamp:
- Mar 6, 2024, 6:06:30 AM (5 months ago)
- Branches:
- master
- Children:
- f6e8c67
- Parents:
- 00eaeb8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
r00eaeb8 rbbf2cb1 366 366 } 367 367 368 void ConversionCost::postvisit( const ast::EnumInstType * ) {368 void ConversionCost::postvisit( const ast::EnumInstType * inst ) { 369 369 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 370 370 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); … … 374 374 } 375 375 376 void ConversionCost::postvisit( const ast::EnumPosType * ) { 377 if ( dynamic_cast<const ast::EnumPosType *>( dst ) ) { 378 // Tempoarary 379 cost = Cost::zero; 380 } else { 376 void ConversionCost::postvisit( const ast::EnumPosType * src ) { 377 if ( auto dstBase = dynamic_cast<const ast::EnumPosType *>( dst ) ) { 378 // cost = costCalc( src->instance, dstBase->instance, srcIsLvalue, symtab, env ); 379 // if ( cost < Cost::unsafe ) cost.incSafe(); 380 cost = Cost::zero; 381 } 382 // if ( auto dstBase = dynamic_cast<const ast::EnumInstType *>( dst ) ) { 383 // cost = costCalc( src->instance, dstBase, srcIsLvalue, symtab, env ); 384 // if ( cost < Cost::unsafe ) cost.incSafe(); 385 // } 386 else { 381 387 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 382 388 cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
Note: See TracChangeset
for help on using the changeset viewer.