Changeset af746cc for src/SymTab


Ignore:
Timestamp:
Apr 15, 2024, 12:03:53 PM (4 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
dc58e5d
Parents:
d9bad51
Message:

Reimplement the resolution of Enum instance type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    rd9bad51 raf746cc  
    5858        void postvisit( const ast::OneType * oneType );
    5959        void postvisit( const ast::QualifiedType * qualType );
    60 
    61         void postvisit( const ast::EnumPosType * posType );
     60        void postvisit( const ast::EnumAttrType * posType );
    6261
    6362        /// The result is the current constructed mangled name.
     
    281280}
    282281
    283 void Mangler::postvisit( const ast::EnumPosType * pos ) {
    284         postvisit( pos->instance );
    285         mangleName += "_pos";
     282void Mangler::postvisit( const ast::EnumAttrType * enumAttr ) {
     283        postvisit( enumAttr->instance );
     284        // mangleName += "_pos";
     285    switch ( enumAttr->attr )
     286    {
     287        case ast::EnumAttribute::Label:
     288            mangleName += "_label_";
     289            break;
     290        case ast::EnumAttribute::Posn:
     291                        mangleName += "_posn_";
     292            break;
     293        case ast::EnumAttribute::Value:
     294            mangleName += "_value_";
     295            break;
     296    }
     297
    286298}
    287299
Note: See TracChangeset for help on using the changeset viewer.