Ignore:
Timestamp:
Apr 18, 2024, 8:44:24 PM (4 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
19313be5, cf191ac
Parents:
748c751 (diff), 7a780ad (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    r748c751 r38093ae  
    3838        // GENERATED START, DO NOT EDIT
    3939        // GENERATED BY BasicTypes-gen.cc
    40         #define BT ast::BasicType::
    41         static const BT Kind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor
     40        #define BT ast::BasicKind::
     41        static const ast::BasicKind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor
    4242                /*                                      B                       C                      SC                      UC                      SI                     SUI
    4343                                                        I                      UI                      LI                     LUI                     LLI                    LLUI
     
    339339        // GENERATED END
    340340        static_assert(
    341                 sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::BasicType::NUMBER_OF_BASIC_TYPES * ast::BasicType::NUMBER_OF_BASIC_TYPES,
     341                sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::BasicKind::NUMBER_OF_BASIC_TYPES * ast::BasicKind::NUMBER_OF_BASIC_TYPES,
    342342                "Each basic type kind should have a corresponding row in the combined type matrix"
    343343        );
     
    366366        void postvisit( const ast::BasicType * basic ) {
    367367                if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) {
    368                         ast::BasicType::Kind kind;
     368                        ast::BasicKind kind;
    369369                        if (basic->kind != basic2->kind && !widen.first && !widen.second) return;
    370370                        else if (!widen.first) kind = basic->kind; // widen.second
     
    386386                        const ast::EnumDecl* enumDecl = enumInst->base;
    387387                        if ( !enumDecl->base ) {
    388                                 ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];
     388                                ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ];
    389389                                if (
    390390                                        ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
     
    398398                } else if ( auto type2AsAttr = dynamic_cast< const ast::EnumAttrType * >( type2 ) ) {
    399399            if ( type2AsAttr->attr == ast::EnumAttribute::Posn ) {
    400                             ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];
     400                            ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ];
    401401                            if (
    402402                                    ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
     
    649649        void postvisit( const ast::EnumInstType * enumInst ) {
    650650                if ( enumInst->base && !enumInst->base->base ) {
    651                         auto basicType = new ast::BasicType( ast::BasicType::UnsignedInt );
     651                        auto basicType = new ast::BasicType( ast::BasicKind::UnsignedInt );
    652652                        result = commonType( basicType, type2, tenv, need, have, open, widen);
    653653                }
     
    674674                } else if ( widen.second && dynamic_cast< const ast::OneType * >( type2 ) ) {
    675675                        result = new ast::BasicType{
    676                                 ast::BasicType::SignedInt, zero->qualifiers | type2->qualifiers };
     676                                ast::BasicKind::SignedInt, zero->qualifiers | type2->qualifiers };
    677677                } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) {
    678678                        const ast::EnumDecl * enumDecl = enumInst->base;
     
    695695                } else if ( widen.second && dynamic_cast< const ast::ZeroType * >( type2 ) ) {
    696696                        result = new ast::BasicType{
    697                                 ast::BasicType::SignedInt, one->qualifiers | type2->qualifiers };
     697                                ast::BasicKind::SignedInt, one->qualifiers | type2->qualifiers };
    698698                } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) {
    699699                        const ast::EnumDecl * enumDecl = enumInst->base;
Note: See TracChangeset for help on using the changeset viewer.