- File:
-
- 1 edited
-
src/ResolvExpr/ConversionCost.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
rbbf2cb1 r0522ebe 288 288 cost = Cost::unsafe; 289 289 } 290 } else if ( dynamic_cast< const ast::EnumPosType *>(dst) ) {291 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };292 cost = costCalc( basicType, integer, srcIsLvalue, symtab, env );293 290 } 294 291 } … … 366 363 } 367 364 368 void ConversionCost::postvisit( const ast::EnumInstType * inst ) { 365 void ConversionCost::postvisit( const ast::EnumInstType * ) { 366 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 367 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 368 // } 369 if ( cost < Cost::unsafe ) { 370 cost.incSafe(); 371 } 372 } 373 374 void ConversionCost::postvisit( const ast::EnumPosType * ) { 369 375 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) }; 370 376 cost = costCalc( integer, dst, srcIsLvalue, symtab, env ); … … 372 378 cost.incSafe(); 373 379 } 374 }375 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 {387 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };388 cost = costCalc( integer, dst, srcIsLvalue, symtab, env );389 if ( cost < Cost::unsafe ) {390 cost.incSafe();391 }392 }393 394 380 } 395 381
Note:
See TracChangeset
for help on using the changeset viewer.