Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8d7bef2
Parents:
6171841
git-author:
Aaron Moss <a3moss@…> (03/16/18 17:04:24)
git-committer:
Aaron Moss <a3moss@…> (03/16/18 17:15:02)
Message:

First pass at delete removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r6171841 r68f9c43  
    4444}
    4545
    46 Statement::~Statement() {}
    47 
    4846ExprStmt::ExprStmt( Expression *expr ) : Statement(), expr( expr ) {}
    4947
    5048ExprStmt::ExprStmt( const ExprStmt &other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
    51 
    52 ExprStmt::~ExprStmt() {
    53         delete expr;
    54 }
    5549
    5650void ExprStmt::print( std::ostream &os, Indenter indent ) const {
     
    6660  cloneAll( other.input, input );
    6761  cloneAll( other.clobber, clobber );
    68 }
    69 
    70 AsmStmt::~AsmStmt() {
    71         delete instruction;
    72         deleteAll( output );
    73         deleteAll( input );
    74         deleteAll( clobber );
    7562}
    7663
     
    122109ReturnStmt::ReturnStmt( const ReturnStmt & other ) : Statement( other ), expr( maybeClone( other.expr ) ) {}
    123110
    124 ReturnStmt::~ReturnStmt() {
    125         delete expr;
    126 }
    127 
    128111void ReturnStmt::print( std::ostream &os, Indenter indent ) const {
    129112        os << "Return Statement, returning: ";
     
    141124        Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) {
    142125        cloneAll( other.initialization, initialization );
    143 }
    144 
    145 IfStmt::~IfStmt() {
    146         deleteAll( initialization );
    147         delete condition;
    148         delete thenPart;
    149         delete elsePart;
    150126}
    151127
     
    185161}
    186162
    187 SwitchStmt::~SwitchStmt() {
    188         delete condition;
    189         // destroy statements
    190         deleteAll( statements );
    191 }
    192 
    193163void SwitchStmt::print( std::ostream &os, Indenter indent ) const {
    194164        os << "Switch on condition: ";
     
    209179        Statement( other ), condition( maybeClone(other.condition ) ), _isDefault( other._isDefault ) {
    210180        cloneAll( other.stmts, stmts );
    211 }
    212 
    213 CaseStmt::~CaseStmt() {
    214         delete condition;
    215         deleteAll( stmts );
    216181}
    217182
     
    243208}
    244209
    245 WhileStmt::~WhileStmt() {
    246         delete body;
    247         delete condition;
    248 }
    249 
    250210void WhileStmt::print( std::ostream &os, Indenter indent ) const {
    251211        os << "While on condition: " << endl ;
     
    265225                cloneAll( other.initialization, initialization );
    266226
    267 }
    268 
    269 ForStmt::~ForStmt() {
    270         deleteAll( initialization );
    271         delete condition;
    272         delete increment;
    273         delete body;
    274227}
    275228
     
    311264ThrowStmt::ThrowStmt( const ThrowStmt &other ) :
    312265        Statement ( other ), kind( other.kind ), expr( maybeClone( other.expr ) ), target( maybeClone( other.target ) ) {
    313 }
    314 
    315 ThrowStmt::~ThrowStmt() {
    316         delete expr;
    317         delete target;
    318266}
    319267
     
    336284}
    337285
    338 TryStmt::~TryStmt() {
    339         delete block;
    340         deleteAll( handlers );
    341         delete finallyBlock;
    342 }
    343 
    344286void TryStmt::print( std::ostream &os, Indenter indent ) const {
    345287        os << "Try Statement" << endl;
     
    370312}
    371313
    372 CatchStmt::~CatchStmt() {
    373         delete decl;
    374         delete body;
    375 }
    376 
    377314void CatchStmt::print( std::ostream &os, Indenter indent ) const {
    378315        os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl;
     
    397334
    398335FinallyStmt::FinallyStmt( const FinallyStmt & other ) : Statement( other ), block( maybeClone( other.block ) ) {
    399 }
    400 
    401 FinallyStmt::~FinallyStmt() {
    402         delete block;
    403336}
    404337
     
    434367}
    435368
    436 WaitForStmt::~WaitForStmt() {
    437         for( auto & clause : clauses ) {
    438                 delete clause.target.function;
    439                 deleteAll( clause.target.arguments );
    440                 delete clause.statement;
    441                 delete clause.condition;
    442         }
    443 
    444         delete timeout.time;
    445         delete timeout.statement;
    446         delete timeout.condition;
    447 
    448         delete orelse.statement;
    449         delete orelse.condition;
    450 }
    451 
    452369void WaitForStmt::print( std::ostream &os, Indenter indent ) const {
    453370        os << "Waitfor Statement" << endl;
     
    460377WithStmt::WithStmt( const WithStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) {
    461378        cloneAll( other.exprs, exprs );
    462 }
    463 WithStmt::~WithStmt() {
    464         deleteAll( exprs );
    465         delete stmt;
    466379}
    467380
     
    489402}
    490403
    491 ImplicitCtorDtorStmt::~ImplicitCtorDtorStmt() {
    492         delete callStmt;
    493 }
    494 
    495404void ImplicitCtorDtorStmt::print( std::ostream &os, Indenter indent ) const {
    496405        os << "Implicit Ctor Dtor Statement" << endl;
Note: See TracChangeset for help on using the changeset viewer.