Changeset 85855b0 for src/ResolvExpr/CastCost.cpp
- Timestamp:
- Jun 10, 2024, 2:43:13 AM (2 months ago)
- Branches:
- master
- Children:
- 42cdd07d
- Parents:
- d68de59
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CastCost.cpp
rd68de59 r85855b0 36 36 namespace ResolvExpr { 37 37 38 Cost castCost( 39 const ast::Type * src, const ast::Type * dst, bool srcIsLvalue, 40 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env 41 ); 42 38 43 namespace { 39 44 struct CastCost : public ConversionCost { … … 45 50 const ast::TypeEnvironment & env, CostCalculation costFunc ) 46 51 : ConversionCost( dst, srcIsLvalue, symtab, env, costFunc ) {} 52 53 void postvisit( const ast::EnumInstType * enumInst ) { 54 cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env ); 55 } 47 56 48 57 void postvisit( const ast::BasicType * basicType ) { … … 104 113 cost = Cost::unsafe; 105 114 } 106 }107 }108 109 void postvist( const ast::EnumInstType * ) {110 if ( auto basic = dynamic_cast< const ast::BasicType * >(dst) ) {111 if ( basic->isInteger() ) cost = Cost::unsafe;112 115 } 113 116 }
Note: See TracChangeset
for help on using the changeset viewer.