Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    r6d51bd7 re0115286  
    5757        static readonly<Decl> fromId( UniqueId id );
    5858
    59         virtual const Decl * accept( Visitor & v ) const override = 0;
    60 private:
    61         virtual Decl * clone() const override = 0;
     59        virtual Decl* accept( Visitor& v ) override = 0;
     60private:
     61        virtual Decl* clone() const override = 0;
    6262};
    6363
     
    8585
    8686        /// Get type of this declaration. May be generated by subclass
    87         virtual const Type * get_type() const = 0;
     87        virtual const Type* get_type() const = 0;
    8888        /// Set type of this declaration. May be verified by subclass
    8989        virtual void set_type(Type*) = 0;
    9090
    91         virtual const DeclWithType * accept( Visitor & v ) const override = 0;
    92 private:
    93         virtual DeclWithType * clone() const override = 0;
     91        virtual DeclWithType* accept( Visitor& v ) override = 0;
     92private:
     93        virtual DeclWithType* clone() const override = 0;
    9494};
    9595
     
    110110        void set_type( Type* ty ) override { type = ty; }
    111111
    112         virtual const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); }
    113 private:
    114         virtual ObjectDecl * clone() const override { return new ObjectDecl{ *this }; }
    115 
    116         /// Must be copied in ALL derived classes
    117         template<typename node_t>
    118         friend auto mutate(const node_t * node);
     112        DeclWithType* accept( Visitor& v ) override { return v.visit( this ); }
     113private:
     114        ObjectDecl* clone() const override { return new ObjectDecl{ *this }; }
    119115};
    120116
     
    170166        std::string genTypeString() const;
    171167
    172         virtual const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    173 private:
    174         virtual TypeDecl * clone() const override { return new TypeDecl{ *this }; }
     168        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     169private:
     170        TypeDecl* clone() const override { return new TypeDecl{ *this }; }
    175171};
    176172
     
    184180        std::string typeString() const override { return "typedef"; }
    185181
    186         virtual const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    187 private:
    188         virtual TypedefDecl * clone() const override { return new TypedefDecl{ *this }; }
     182        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     183private:
     184        TypedefDecl* clone() const override { return new TypedefDecl{ *this }; }
    189185};
    190186
     
    224220        bool is_thread() { return kind == DeclarationNode::Thread; }
    225221
    226         virtual const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    227 private:
    228         virtual StructDecl * clone() const override { return new StructDecl{ *this }; }
     222        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     223private:
     224        StructDecl* clone() const override { return new StructDecl{ *this }; }
    229225
    230226        std::string typeString() const override { return "struct"; }
     
    238234        : AggregateDecl( loc, name, std::move(attrs), linkage ) {}
    239235
    240         virtual const Decl * accept( Visitor& v ) const override { return v.visit( this ); }
    241 private:
    242         virtual UnionDecl * clone() const override { return new UnionDecl{ *this }; }
     236        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     237private:
     238        UnionDecl* clone() const override { return new UnionDecl{ *this }; }
    243239
    244240        std::string typeString() const override { return "union"; }
     
    255251        bool valueOf( Decl* enumerator, long long& value ) const;
    256252
    257         virtual const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    258 private:
    259         virtual EnumDecl * clone() const override { return new EnumDecl{ *this }; }
     253        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     254private:
     255        EnumDecl* clone() const override { return new EnumDecl{ *this }; }
    260256
    261257        std::string typeString() const override { return "enum"; }
     
    272268        : AggregateDecl( loc, name, std::move(attrs), linkage ) {}
    273269
    274         virtual const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
    275 private:
    276         virtual TraitDecl * clone() const override { return new TraitDecl{ *this }; }
     270        Decl* accept( Visitor& v ) override { return v.visit( this ); }
     271private:
     272        TraitDecl* clone() const override { return new TraitDecl{ *this }; }
    277273
    278274        std::string typeString() const override { return "trait"; }
     
    291287inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); }
    292288inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    293 // inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); }
    294 // inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     289inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); }
     290inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    295291inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); }
    296292inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     
    307303inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
    308304inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    309 // inline void increment( const class FtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
    310 // inline void decrement( const class FtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    311 // inline void increment( const class DtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
    312 // inline void decrement( const class DtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     305inline void increment( const class FtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
     306inline void decrement( const class FtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     307inline void increment( const class DtypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
     308inline void decrement( const class DtypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    313309inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); }
    314310inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    315 // inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); }
    316 // inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    317 // inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); }
    318 // inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     311inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); }
     312inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); }
     313inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); }
     314inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); }
    319315
    320316}
Note: See TracChangeset for help on using the changeset viewer.