Changeset 87701b6 for src/AST/Init.hpp


Ignore:
Timestamp:
May 16, 2019, 4:13:19 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e61207e7
Parents:
1fb7bfd
Message:

Tentative fix for increment/decrement and implented a few more visits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Init.hpp

    r1fb7bfd r87701b6  
    5454        const Init * accept( Visitor& v ) const override = 0;
    5555private:
    56         const Init * clone() const override = 0;
     56        Init * clone() const override = 0;
    5757};
    5858
     
    7272        /// Must be copied in ALL derived classes
    7373        template<typename node_t>
    74         friend auto mutate(const node_t * node);
     74        friend node_t * mutate(const node_t * node);
    7575};
    7676
     
    100100        /// Must be copied in ALL derived classes
    101101        template<typename node_t>
    102         friend auto mutate(const node_t * node);
     102        friend node_t * mutate(const node_t * node);
    103103};
    104104
     
    123123        /// Must be copied in ALL derived classes
    124124        template<typename node_t>
    125         friend auto mutate(const node_t * node);
     125        friend node_t * mutate(const node_t * node);
    126126};
    127127
    128 
    129 //=================================================================================================
    130 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
    131 /// remove only if there is a better solution
    132 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
    133 /// forward declarations
    134 inline void increment( const class Init * node, Node::ref_type ref ) { node->increment( ref ); }
    135 inline void decrement( const class Init * node, Node::ref_type ref ) { node->decrement( ref ); }
    136 inline void increment( const class SingleInit * node, Node::ref_type ref ) { node->increment( ref ); }
    137 inline void decrement( const class SingleInit * node, Node::ref_type ref ) { node->decrement( ref ); }
    138 inline void increment( const class ListInit * node, Node::ref_type ref ) { node->increment( ref ); }
    139 inline void decrement( const class ListInit * node, Node::ref_type ref ) { node->decrement( ref ); }
    140 inline void increment( const class ConstructorInit * node, Node::ref_type ref ) { node->increment( ref ); }
    141 inline void decrement( const class ConstructorInit * node, Node::ref_type ref ) { node->decrement( ref ); }
    142128}
    143129
Note: See TracChangeset for help on using the changeset viewer.