Ignore:
Timestamp:
Apr 18, 2024, 8:38:33 PM (7 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
38093ae
Parents:
cdb4eaa
Message:

Remove unnecessary implicit enum type conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cc

    rcdb4eaa r748c751  
    379379void ConversionCost::postvisit( const ast::EnumAttrType * src ) {
    380380    auto dstAsEnumAttrType = dynamic_cast<const ast::EnumAttrType *>(dst);
    381     if ( src->attr == ast::EnumAttribute::Label ) {
    382         if ( dstAsEnumAttrType && dstAsEnumAttrType->attr == ast::EnumAttribute::Label ) {
    383             cost = costCalc( src->instance, dstAsEnumAttrType->instance, srcIsLvalue, symtab, env );
    384         }
    385         // Add Conversion To String
    386     } else if ( src->attr == ast::EnumAttribute::Value ) {
     381        assert( src->attr != ast::EnumAttribute::Label );
     382    if ( src->attr == ast::EnumAttribute::Value ) {
    387383        if ( dstAsEnumAttrType && dstAsEnumAttrType->attr == ast::EnumAttribute::Value) {
    388384            cost = costCalc( src->instance, dstAsEnumAttrType->instance, srcIsLvalue, symtab, env );
Note: See TracChangeset for help on using the changeset viewer.