Ignore:
Timestamp:
Feb 25, 2016, 4:45:19 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
41a2620
Parents:
6ce67ce
Message:

added copy constructors and destructors to many types that were missing them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.h

    r6ce67ce r3be261a  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Statement.h -- 
     7// Statement.h --
    88//
    99// Author           : Richard C. Bilson
     
    5757  public:
    5858        ExprStmt( std::list<Label> labels, Expression *expr );
     59        ExprStmt( const ExprStmt &other );
    5960        virtual ~ExprStmt();
    6061
     
    7374  public:
    7475        AsmStmt( std::list<Label> labels, bool voltile, ConstantExpr *instruction, std::list<Expression *> input, std::list<Expression *> output, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
     76        AsmStmt( const AsmStmt &other );
    7577        virtual ~AsmStmt();
    7678
     
    103105  public:
    104106        IfStmt( std::list<Label> labels, Expression *condition, Statement *thenPart, Statement *elsePart );
     107        IfStmt( const IfStmt &other );
    105108        virtual ~IfStmt();
    106109
     
    111114        Statement *get_elsePart() { return elsePart; }
    112115        void set_elsePart( Statement *newValue ) { elsePart = newValue; }
    113        
     116
    114117        virtual IfStmt *clone() const { return new IfStmt( *this ); }
    115118        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    125128  public:
    126129        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
     130        SwitchStmt( const SwitchStmt &other );
    127131        virtual ~SwitchStmt();
    128132
     
    146150  public:
    147151        ChooseStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &branches );
     152        ChooseStmt( const ChooseStmt &other );
    148153        virtual ~ChooseStmt();
    149154
     
    177182class CaseStmt : public Statement {
    178183  public:
    179         CaseStmt( std::list<Label> labels, Expression *conditions, 
     184        CaseStmt( std::list<Label> labels, Expression *conditions,
    180185              std::list<Statement *> &stmts, bool isdef = false ) throw(SemanticError);
     186        CaseStmt( const CaseStmt &other );
    181187        virtual ~CaseStmt();
    182188
     
    192198        std::list<Statement *> &get_statements() { return stmts; }
    193199        void set_statements( std::list<Statement *> &newValue ) { stmts = newValue; }
    194        
     200
    195201        virtual void accept( Visitor &v ) { v.visit( this ); }
    196202        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     
    208214        WhileStmt( std::list<Label> labels, Expression *condition,
    209215               Statement *body, bool isDoWhile = false );
     216        WhileStmt( const WhileStmt &other );
    210217        virtual ~WhileStmt();
    211218
     
    216223        bool get_isDoWhile() { return isDoWhile; }
    217224        void set_isDoWhile( bool newValue ) { isDoWhile = newValue; }
    218        
     225
    219226        virtual WhileStmt *clone() const { return new WhileStmt( *this ); }
    220227        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    231238        ForStmt( std::list<Label> labels, std::list<Statement *> initialization,
    232239             Expression *condition = 0, Expression *increment = 0, Statement *body = 0 );
     240        ForStmt( const ForStmt &other );
    233241        virtual ~ForStmt();
    234242
     
    241249        Statement *get_body() { return body; }
    242250        void set_body( Statement *newValue ) { body = newValue; }
    243        
     251
    244252        virtual ForStmt *clone() const { return new ForStmt( *this ); }
    245253        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    259267        BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError);
    260268        BranchStmt( std::list<Label> labels, Expression *computedTarget, Type ) throw (SemanticError);
    261         virtual ~BranchStmt() {}
    262269
    263270        Label get_originalTarget() { return originalTarget; }
    264271        Label get_target() { return target; }
    265272        void set_target( Label newValue ) { target = newValue; }
    266        
     273
    267274        Expression *get_computedTarget() { return computedTarget; }
    268275        void set_target( Expression * newValue ) { computedTarget = newValue; }
     
    286293  public:
    287294        ReturnStmt( std::list<Label> labels, Expression *expr, bool throwP = false );
     295        ReturnStmt( const ReturnStmt &other );
    288296        virtual ~ReturnStmt();
    289297
    290298        Expression *get_expr() { return expr; }
    291299        void set_expr( Expression *newValue ) { expr = newValue; }
    292        
     300
    293301        virtual ReturnStmt *clone() const { return new ReturnStmt( *this ); }
    294302        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    305313        NullStmt();
    306314        NullStmt( std::list<Label> labels );
    307         virtual ~NullStmt();
    308315
    309316        virtual NullStmt *clone() const { return new NullStmt( *this ); }
     
    311318        virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    312319        virtual void print( std::ostream &os, int indent = 0 ) const;
    313        
    314   private:
    315 };
    316 
    317 class TryStmt : public Statement { 
     320
     321  private:
     322};
     323
     324class TryStmt : public Statement {
    318325  public:
    319326        TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<Statement *> &handlers, FinallyStmt *finallyBlock = 0 );
     
    332339        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    333340        virtual void print( std::ostream &os, int indent = 0 ) const;
    334        
     341
    335342  private:
    336343        CompoundStmt *block;
    337344        std::list<Statement *> handlers;
    338345        FinallyStmt *finallyBlock;
    339 }; 
     346};
    340347
    341348class CatchStmt : public Statement {
    342349  public:
    343350        CatchStmt( std::list<Label> labels, Declaration *decl, Statement *body, bool isCatchRest = false );
     351        CatchStmt( const CatchStmt &other );
    344352        virtual ~CatchStmt();
    345353
     
    349357        Statement *get_body() { return body; }
    350358        void set_body( Statement *newValue ) { body = newValue; }
    351        
     359
    352360        virtual CatchStmt *clone() const { return new CatchStmt( *this ); }
    353361        virtual void accept( Visitor &v ) { v.visit( this ); }
    354362        virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    355363        virtual void print( std::ostream &os, int indent = 0 ) const;
    356        
     364
    357365  private:
    358366        Declaration *decl;
     
    361369};
    362370
    363 class FinallyStmt : public Statement { 
     371class FinallyStmt : public Statement {
    364372  public:
    365373        FinallyStmt( std::list<Label> labels, CompoundStmt *block );
     374        FinallyStmt( const FinallyStmt &other );
    366375        virtual ~FinallyStmt();
    367376
    368377        CompoundStmt *get_block() const { return block; }
    369378        void set_block( CompoundStmt *newValue ) { block = newValue; }
    370        
     379
    371380        virtual FinallyStmt *clone() const { return new FinallyStmt( *this ); }
    372381        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    375384  private:
    376385        CompoundStmt *block;
    377 }; 
     386};
    378387
    379388
Note: See TracChangeset for help on using the changeset viewer.