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

    r1fb7bfd r87701b6  
    111111        /// Must be copied in ALL derived classes
    112112        template<typename node_t>
    113         friend auto mutate(const node_t * node);
     113        friend node_t * mutate(const node_t * node);
    114114};
    115115
     
    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
     
    201201        /// Must be copied in ALL derived classes
    202202        template<typename node_t>
    203         friend auto mutate(const node_t * node);
     203        friend node_t * mutate(const node_t * node);
    204204};
    205205
     
    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
     
    263263        /// Must be copied in ALL derived classes
    264264        template<typename node_t>
    265         friend auto mutate(const node_t * node);
     265        friend node_t * mutate(const node_t * node);
    266266
    267267        std::string typeString() const override { return "struct"; }
     
    281281        /// Must be copied in ALL derived classes
    282282        template<typename node_t>
    283         friend auto mutate(const node_t * node);
     283        friend node_t * mutate(const node_t * node);
    284284
    285285        std::string typeString() const override { return "union"; }
     
    302302        /// Must be copied in ALL derived classes
    303303        template<typename node_t>
    304         friend auto mutate(const node_t * node);
     304        friend node_t * mutate(const node_t * node);
    305305
    306306        std::string typeString() const override { return "enum"; }
     
    323323        /// Must be copied in ALL derived classes
    324324        template<typename node_t>
    325         friend auto mutate(const node_t * node);
     325        friend node_t * mutate(const node_t * node);
    326326
    327327        std::string typeString() const override { return "trait"; }
     
    341341        /// Must be copied in ALL derived classes
    342342        template<typename node_t>
    343         friend auto mutate(const node_t * node);
     343        friend node_t * mutate(const node_t * node);
    344344};
    345345
     
    358358        /// Must be copied in ALL derived classes
    359359        template<typename node_t>
    360         friend auto mutate(const node_t * node);
    361 };
    362 
    363 //=================================================================================================
    364 /// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
    365 /// remove only if there is a better solution
    366 /// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
    367 /// forward declarations
    368 inline void increment( const class Decl * node, Node::ref_type ref ) { node->increment(ref); }
    369 inline void decrement( const class Decl * node, Node::ref_type ref ) { node->decrement(ref); }
    370 inline void increment( const class DeclWithType * node, Node::ref_type ref ) { node->increment(ref); }
    371 inline void decrement( const class DeclWithType * node, Node::ref_type ref ) { node->decrement(ref); }
    372 inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); }
    373 inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    374 inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); }
    375 inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    376 inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); }
    377 inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    378 inline void increment( const class StructDecl * node, Node::ref_type ref ) { node->increment(ref); }
    379 inline void decrement( const class StructDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    380 inline void increment( const class UnionDecl * node, Node::ref_type ref ) { node->increment(ref); }
    381 inline void decrement( const class UnionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    382 inline void increment( const class EnumDecl * node, Node::ref_type ref ) { node->increment(ref); }
    383 inline void decrement( const class EnumDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    384 inline void increment( const class TraitDecl * node, Node::ref_type ref ) { node->increment(ref); }
    385 inline void decrement( const class TraitDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    386 inline void increment( const class NamedTypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
    387 inline void decrement( const class NamedTypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    388 inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
    389 inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    390 inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); }
    391 inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    392 inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); }
    393 inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    394 inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); }
    395 inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     360        friend node_t * mutate(const node_t * node);
     361};
    396362
    397363}
Note: See TracChangeset for help on using the changeset viewer.