Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rdd6d7c6 r4073b16  
    12871287
    12881288        const ast::Designation * visit( const ast::Designation * node ) override final {
    1289                 auto designation = new Designation( get<Expression>().acceptL( node->designators ) );
    1290                 designation->location = node->location;
    1291                 this->node = designation;
     1289                (void)node;
    12921290                return nullptr;
    12931291        }
    12941292
    12951293        const ast::Init * visit( const ast::SingleInit * node ) override final {
    1296                 auto init = new SingleInit(
    1297                         get<Expression>().accept1( node->value ),
    1298                         ast::MaybeConstruct == node->maybeConstructed
    1299                 );
    1300                 init->location = node->location;
    1301                 this->node = init;
     1294                (void)node;
    13021295                return nullptr;
    13031296        }
    13041297
    13051298        const ast::Init * visit( const ast::ListInit * node ) override final {
    1306                 auto init = new ListInit(
    1307                         get<Initializer>().acceptL( node->initializers ),
    1308                         get<Designation>().acceptL( node->designations ),
    1309                         ast::MaybeConstruct == node->maybeConstructed
    1310                 );
    1311                 init->location = node->location;
    1312                 this->node = init;
     1299                (void)node;
    13131300                return nullptr;
    13141301        }
    13151302
    13161303        const ast::Init * visit( const ast::ConstructorInit * node ) override final {
    1317                 auto init = new ConstructorInit(
    1318                         get<Statement>().accept1( node->ctor ),
    1319                         get<Statement>().accept1( node->dtor ),
    1320                         get<Initializer>().accept1( node->init )
    1321                 );
    1322                 init->location = node->location;
    1323                 this->node = init;
     1304                (void)node;
    13241305                return nullptr;
    13251306        }
    13261307
    13271308        const ast::Attribute * visit( const ast::Attribute * node ) override final {
    1328                 auto attr = new Attribute(
    1329                         node->name,
    1330                         get<Expression>().acceptL(node->parameters)
    1331                 );
    1332                 this->node = attr;
     1309                (void)node;
    13331310                return nullptr;
    13341311        }
    13351312
    13361313        const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) override final {
    1337                 // Handled by convertTypeSubstitution helper instead.
    1338                 // TypeSubstitution is not a node in the old model, so the conversion result wouldn't fit in this->node.
    1339                 assert( 0 );
     1314                (void)node;
    13401315                return nullptr;
    13411316        }
     
    26422617        }
    26432618
    2644         virtual void visit( Designation * old ) override final {
    2645                 this->node = new ast::Designation(
    2646                         old->location,
    2647                         GET_ACCEPT_V(designators, Expr)
    2648                 );
    2649         }
    2650 
    2651         virtual void visit( SingleInit * old ) override final {
    2652                 this->node = new ast::SingleInit(
    2653                         old->location,
    2654                         GET_ACCEPT_1(value, Expr),
    2655                         (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct
    2656                 );
    2657         }
    2658 
    2659         virtual void visit( ListInit * old ) override final {
    2660                 this->node = new ast::ListInit(
    2661                         old->location,
    2662                         GET_ACCEPT_V(initializers, Init),
    2663                         GET_ACCEPT_V(designations, Designation),
    2664                         (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::DoConstruct
    2665                 );
    2666         }
    2667 
    2668         virtual void visit( ConstructorInit * old ) override final {
    2669                 this->node = new ast::ConstructorInit(
    2670                         old->location,
    2671                         GET_ACCEPT_1(ctor, Stmt),
    2672                         GET_ACCEPT_1(dtor, Stmt),
    2673                         GET_ACCEPT_1(init, Init)
    2674                 );
     2619        virtual void visit( Designation * ) override final {
     2620
     2621        }
     2622
     2623        virtual void visit( SingleInit * ) override final {
     2624
     2625        }
     2626
     2627        virtual void visit( ListInit * ) override final {
     2628
     2629        }
     2630
     2631        virtual void visit( ConstructorInit * ) override final {
     2632
    26752633        }
    26762634
    26772635        virtual void visit( Constant * ) override final {
    2678                 // Handled in visit( ConstantEpxr * ).
    2679                 // In the new tree, Constant fields are inlined into containing ConstantExpression.
     2636
     2637        }
     2638
     2639        virtual void visit( Attribute * ) override final {
     2640
     2641        }
     2642
     2643        virtual void visit( AttrExpr * ) override final {
     2644
    26802645                assert( 0 );
    2681         }
    2682 
    2683         virtual void visit( Attribute * old ) override final {
    2684                 this->node = new ast::Attribute(
    2685                         old->name,
    2686                         GET_ACCEPT_V( parameters, Expr )
    2687                 );
    2688         }
    2689 
    2690         virtual void visit( AttrExpr * ) override final {
    2691                 assertf( false, "AttrExpr deprecated in new AST." );
    26922646        }
    26932647};
Note: See TracChangeset for help on using the changeset viewer.