Changeset 87701b6 for src/AST/Stmt.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/Stmt.hpp

    r1fb7bfd r87701b6  
    6565        /// Must be copied in ALL derived classes
    6666        template<typename node_t>
    67         friend auto mutate(const node_t * node);
     67        friend node_t * mutate(const node_t * node);
    6868};
    6969
     
    8080        /// Must be copied in ALL derived classes
    8181        template<typename node_t>
    82         friend auto mutate(const node_t * node);
     82        friend node_t * mutate(const node_t * node);
    8383};
    8484
     
    9696        /// Must be copied in ALL derived classes
    9797        template<typename node_t>
    98         friend auto mutate(const node_t * node);
     98        friend node_t * mutate(const node_t * node);
    9999};
    100100
     
    121121        /// Must be copied in ALL derived classes
    122122        template<typename node_t>
    123         friend auto mutate(const node_t * node);
     123        friend node_t * mutate(const node_t * node);
    124124};
    125125
     
    138138        /// Must be copied in ALL derived classes
    139139        template<typename node_t>
    140         friend auto mutate(const node_t * node);
     140        friend node_t * mutate(const node_t * node);
    141141};
    142142
     
    160160        /// Must be copied in ALL derived classes
    161161        template<typename node_t>
    162         friend auto mutate(const node_t * node);
     162        friend node_t * mutate(const node_t * node);
    163163};
    164164
     
    178178        /// Must be copied in ALL derived classes
    179179        template<typename node_t>
    180         friend auto mutate(const node_t * node);
     180        friend node_t * mutate(const node_t * node);
    181181};
    182182
     
    198198        /// Must be copied in ALL derived classes
    199199        template<typename node_t>
    200         friend auto mutate(const node_t * node);
     200        friend node_t * mutate(const node_t * node);
    201201};
    202202
     
    219219        /// Must be copied in ALL derived classes
    220220        template<typename node_t>
    221         friend auto mutate(const node_t * node);
     221        friend node_t * mutate(const node_t * node);
    222222};
    223223
     
    240240        /// Must be copied in ALL derived classes
    241241        template<typename node_t>
    242         friend auto mutate(const node_t * node);
     242        friend node_t * mutate(const node_t * node);
    243243};
    244244
     
    268268        /// Must be copied in ALL derived classes
    269269        template<typename node_t>
    270         friend auto mutate(const node_t * node);
     270        friend node_t * mutate(const node_t * node);
    271271
    272272        static const char * kindNames[kindEnd];
     
    286286        /// Must be copied in ALL derived classes
    287287        template<typename node_t>
    288         friend auto mutate(const node_t * node);
     288        friend node_t * mutate(const node_t * node);
    289289};
    290290
     
    307307        /// Must be copied in ALL derived classes
    308308        template<typename node_t>
    309         friend auto mutate(const node_t * node);
     309        friend node_t * mutate(const node_t * node);
    310310};
    311311
     
    327327        /// Must be copied in ALL derived classes
    328328        template<typename node_t>
    329         friend auto mutate(const node_t * node);
     329        friend node_t * mutate(const node_t * node);
    330330};
    331331
     
    349349        /// Must be copied in ALL derived classes
    350350        template<typename node_t>
    351         friend auto mutate(const node_t * node);
     351        friend node_t * mutate(const node_t * node);
    352352};
    353353
     
    366366        /// Must be copied in ALL derived classes
    367367        template<typename node_t>
    368         friend auto mutate(const node_t * node);
     368        friend node_t * mutate(const node_t * node);
    369369};
    370370
     
    406406        /// Must be copied in ALL derived classes
    407407        template<typename node_t>
    408         friend auto mutate(const node_t * node);
     408        friend node_t * mutate(const node_t * node);
    409409};
    410410
     
    424424        /// Must be copied in ALL derived classes
    425425        template<typename node_t>
    426         friend auto mutate(const node_t * node);
     426        friend node_t * mutate(const node_t * node);
    427427};
    428428
     
    440440        /// Must be copied in ALL derived classes
    441441        template<typename node_t>
    442         friend auto mutate(const node_t * node);
     442        friend node_t * mutate(const node_t * node);
    443443};
    444444
     
    457457        /// Must be copied in ALL derived classes
    458458        template<typename node_t>
    459         friend auto mutate(const node_t * node);
    460 };
    461 
    462 //=================================================================================================
    463 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
    464 /// remove only if there is a better solution
    465 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
    466 /// forward declarations
    467 inline void increment( const class Stmt * node, Node::ref_type ref ) { node->increment( ref ); }
    468 inline void decrement( const class Stmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    469 inline void increment( const class CompoundStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    470 inline void decrement( const class CompoundStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    471 inline void increment( const class ExprStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    472 inline void decrement( const class ExprStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    473 inline void increment( const class AsmStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    474 inline void decrement( const class AsmStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    475 inline void increment( const class DirectiveStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    476 inline void decrement( const class DirectiveStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    477 inline void increment( const class IfStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    478 inline void decrement( const class IfStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    479 inline void increment( const class WhileStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    480 inline void decrement( const class WhileStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    481 inline void increment( const class ForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    482 inline void decrement( const class ForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    483 inline void increment( const class SwitchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    484 inline void decrement( const class SwitchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    485 inline void increment( const class CaseStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    486 inline void decrement( const class CaseStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    487 inline void increment( const class BranchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    488 inline void decrement( const class BranchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    489 inline void increment( const class ReturnStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    490 inline void decrement( const class ReturnStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    491 inline void increment( const class ThrowStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    492 inline void decrement( const class ThrowStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    493 inline void increment( const class TryStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    494 inline void decrement( const class TryStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    495 inline void increment( const class CatchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    496 inline void decrement( const class CatchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    497 inline void increment( const class FinallyStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    498 inline void decrement( const class FinallyStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    499 inline void increment( const class WaitForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    500 inline void decrement( const class WaitForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    501 inline void increment( const class WithStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    502 inline void decrement( const class WithStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    503 inline void increment( const class DeclStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    504 inline void decrement( const class DeclStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    505 inline void increment( const class NullStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    506 inline void decrement( const class NullStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    507 inline void increment( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    508 inline void decrement( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     459        friend node_t * mutate(const node_t * node);
     460};
    509461
    510462}
Note: See TracChangeset for help on using the changeset viewer.