Changeset 6d51bd7 for src/AST/Stmt.hpp


Ignore:
Timestamp:
May 15, 2019, 10:15:44 AM (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:
be567e9
Parents:
712348a
Message:

Fixes to the new templated pass and started on conversions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r712348a r6d51bd7  
    4040        Stmt(const Stmt& o) : ParseNode(o), labels(o.labels) {}
    4141
    42         virtual Stmt* accept( Visitor& v ) override = 0;
     42        virtual const Stmt* accept( Visitor& v ) const override = 0;
    4343private:
    4444        virtual Stmt* clone() const override = 0;
     
    5959        void push_front( Stmt* s ) { kids.emplace_front( s ); }
    6060
    61         CompoundStmt* accept( Visitor& v ) override { return v.visit( this ); }
     61        virtual const CompoundStmt* accept( Visitor& v ) const override { return v.visit( this ); }
    6262private:
    63         CompoundStmt* clone() const override { return new CompoundStmt{ *this }; }
     63        virtual CompoundStmt* clone() const override { return new CompoundStmt{ *this }; }
    6464};
    6565
     
    7070        : Stmt(loc, std::move(labels)) {}
    7171
    72         NullStmt* accept( Visitor& v ) override { return v.visit( this ); }
     72        virtual const NullStmt * accept( Visitor& v ) const override { return v.visit( this ); }
    7373private:
    74         NullStmt* clone() const override { return new NullStmt{ *this }; }
     74        virtual NullStmt * clone() const override { return new NullStmt{ *this }; }
    7575};
    7676
     
    8282        ExprStmt( const CodeLocation& loc, Expr* e ) : Stmt(loc), expr(e) {}
    8383
    84         Stmt* accept( Visitor& v ) override { return v.visit( this ); }
     84        virtual const Stmt * accept( Visitor& v ) const override { return v.visit( this ); }
    8585private:
    86         ExprStmt* clone() const override { return new ExprStmt{ *this }; }
     86        virtual ExprStmt * clone() const override { return new ExprStmt{ *this }; }
    8787};
    8888
     
    100100inline void increment( const class ExprStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    101101inline void decrement( const class ExprStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    102 inline void increment( const class AsmStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    103 inline void decrement( const class AsmStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    104 inline void increment( const class DirectiveStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    105 inline void decrement( const class DirectiveStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    106 inline void increment( const class IfStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    107 inline void decrement( const class IfStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    108 inline void increment( const class WhileStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    109 inline void decrement( const class WhileStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    110 inline void increment( const class ForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    111 inline void decrement( const class ForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    112 inline void increment( const class SwitchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    113 inline void decrement( const class SwitchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    114 inline void increment( const class CaseStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    115 inline void decrement( const class CaseStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    116 inline void increment( const class BranchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    117 inline void decrement( const class BranchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    118 inline void increment( const class ReturnStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    119 inline void decrement( const class ReturnStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    120 inline void increment( const class ThrowStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    121 inline void decrement( const class ThrowStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    122 inline void increment( const class TryStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    123 inline void decrement( const class TryStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    124 inline void increment( const class CatchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    125 inline void decrement( const class CatchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    126 inline void increment( const class FinallyStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    127 inline void decrement( const class FinallyStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    128 inline void increment( const class WaitForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    129 inline void decrement( const class WaitForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    130 inline void increment( const class WithStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    131 inline void decrement( const class WithStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    132 inline void increment( const class DeclStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    133 inline void decrement( const class DeclStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     102// inline void increment( const class AsmStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     103// inline void decrement( const class AsmStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     104// inline void increment( const class DirectiveStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     105// inline void decrement( const class DirectiveStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     106// inline void increment( const class IfStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     107// inline void decrement( const class IfStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     108// inline void increment( const class WhileStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     109// inline void decrement( const class WhileStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     110// inline void increment( const class ForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     111// inline void decrement( const class ForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     112// inline void increment( const class SwitchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     113// inline void decrement( const class SwitchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     114// inline void increment( const class CaseStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     115// inline void decrement( const class CaseStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     116// inline void increment( const class BranchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     117// inline void decrement( const class BranchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     118// inline void increment( const class ReturnStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     119// inline void decrement( const class ReturnStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     120// inline void increment( const class ThrowStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     121// inline void decrement( const class ThrowStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     122// inline void increment( const class TryStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     123// inline void decrement( const class TryStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     124// inline void increment( const class CatchStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     125// inline void decrement( const class CatchStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     126// inline void increment( const class FinallyStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     127// inline void decrement( const class FinallyStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     128// inline void increment( const class WaitForStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     129// inline void decrement( const class WaitForStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     130// inline void increment( const class WithStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     131// inline void decrement( const class WithStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     132// inline void increment( const class DeclStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     133// inline void decrement( const class DeclStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    134134inline void increment( const class NullStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    135135inline void decrement( const class NullStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    136 inline void increment( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->increment( ref ); }
    137 inline void decrement( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
     136// inline void increment( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->increment( ref ); }
     137// inline void decrement( const class ImplicitCtorDtorStmt * node, Node::ref_type ref ) { node->decrement( ref ); }
    138138
    139139}
Note: See TracChangeset for help on using the changeset viewer.