Changeset 115ac1ce
- Timestamp:
- Jun 29, 2024, 5:29:40 AM (3 months ago)
- Branches:
- master
- Children:
- 73d0e3f4, bc07190
- Parents:
- 4117761
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cpp
r4117761 r115ac1ce 53 53 void postvisit( const ast::EnumInstType * enumInst ) { 54 54 cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env ); 55 56 if ( !enumInst->base->isCfa ) { 57 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) }; 58 Cost intCost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 59 cost = intCost < cost? intCost: cost; 60 } else if ( enumInst->base->isTyped() ) { 55 if ( enumInst->base->isTyped() ) { 61 56 auto baseConversionCost = 62 57 castCost( enumInst->base->base, dst, srcIsLvalue, symtab, env ); 63 58 cost = baseConversionCost < cost? baseConversionCost: cost; 64 59 } 60 static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) }; 61 Cost intCost = costCalc( integer, dst, srcIsLvalue, symtab, env ); 62 intCost.incSafe(); 63 cost = intCost < cost? intCost: cost; 65 64 } 66 65
Note: See TracChangeset
for help on using the changeset viewer.