Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cpp

    rc92bdcc r85855b0  
    3636namespace ResolvExpr {
    3737
     38Cost castCost(
     39        const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
     40        const ast::SymbolTable & symtab, const ast::TypeEnvironment & env
     41);
     42
    3843namespace {
    3944        struct CastCost : public ConversionCost {
     
    4550                        const ast::TypeEnvironment & env, CostCalculation costFunc )
    4651                : ConversionCost( dst, srcIsLvalue, symtab, env, costFunc ) {}
     52
     53                void postvisit( const ast::EnumInstType * enumInst ) {
     54                        cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env );
     55                }
    4756
    4857                void postvisit( const ast::BasicType * basicType ) {
     
    104113                                        cost = Cost::unsafe;
    105114                                }
    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;
    112115                        }
    113116                }
Note: See TracChangeset for help on using the changeset viewer.