Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cpp

    r85855b0 rc92bdcc  
    3636namespace ResolvExpr {
    3737
    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 
    4338namespace {
    4439        struct CastCost : public ConversionCost {
     
    5045                        const ast::TypeEnvironment & env, CostCalculation costFunc )
    5146                : ConversionCost( dst, srcIsLvalue, symtab, env, costFunc ) {}
    52 
    53                 void postvisit( const ast::EnumInstType * enumInst ) {
    54                         cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env );
    55                 }
    5647
    5748                void postvisit( const ast::BasicType * basicType ) {
     
    113104                                        cost = Cost::unsafe;
    114105                                }
     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;
    115112                        }
    116113                }
Note: See TracChangeset for help on using the changeset viewer.