Changeset 76fe046 for src/ResolvExpr


Ignore:
Timestamp:
Mar 6, 2024, 10:55:41 PM (14 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
06601401
Parents:
647d633
Message:

Remove conversion part of the EnumPosType?. It can be resolved by the current unifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/ResolvExpr/ConversionCost.cc

    r647d633 r76fe046  
    379379                // if ( cost < Cost::unsafe ) cost.incSafe();
    380380                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 {
     381        } else if ( auto dstBase = dynamic_cast<const ast::EnumInstType *>( dst ) ) {
     382                cost = costCalc( src->instance, dstBase, srcIsLvalue, symtab, env );
     383                if ( cost < Cost::unsafe ) cost.incSafe();
     384        } else {
    387385                static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };
    388386                cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
Note: See TracChangeset for help on using the changeset viewer.