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/ResolvExpr/Resolver.cc

    r6171841 r68f9c43  
    138138                                        castExpr->arg = nullptr;
    139139                                        std::swap( expr->env, castExpr->env );
    140                                         delete castExpr;
    141140                                }
    142141                        }
     
    198197                        findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, adjust, prune, failFast );
    199198                        finishExpr( choice.expr, choice.env, untyped->env );
    200                         delete untyped;
    201199                        untyped = choice.expr;
    202200                        choice.expr = nullptr;
     
    244242                Expression * newExpr = resolveInVoidContext( untyped, indexer, env );
    245243                finishExpr( newExpr, env, untyped->env );
    246                 delete untyped;
    247244                untyped = newExpr;
    248245        }
     
    418415                        caseStmt->condition = castExpr->arg;
    419416                        castExpr->arg = nullptr;
    420                         delete castExpr;
    421417                }
    422418        }
     
    700696                std::swap( initExpr->env, newExpr->env );
    701697                std::swap( initExpr->inferParams, newExpr->inferParams ) ;
    702                 delete initExpr;
    703698
    704699                // get the actual object's type (may not exactly match what comes back from the resolver due to conversions)
     
    718713                                                        ce->set_arg( nullptr );
    719714                                                        std::swap( ce->env, newExpr->env );
    720                                                         delete ce;
    721715                                                }
    722716                                        }
     
    769763                // could not find valid constructor, or found an intrinsic constructor
    770764                // fall back on C-style initializer
    771                 delete ctorInit->get_ctor();
    772                 ctorInit->set_ctor( NULL );
    773                 delete ctorInit->get_dtor();
    774                 ctorInit->set_dtor( NULL );
     765                ctorInit->set_ctor( nullptr );
     766                ctorInit->set_dtor( nullptr );
    775767                maybeAccept( ctorInit->get_init(), *visitor );
    776768        }
     
    798790
    799791                // found a constructor - can get rid of C-style initializer
    800                 delete ctorInit->init;
    801792                ctorInit->init = nullptr;
    802793
     
    805796                // to clean up generated code.
    806797                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) {
    807                         delete ctorInit->ctor;
    808798                        ctorInit->ctor = nullptr;
    809799                }
    810800
    811801                if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) {
    812                         delete ctorInit->dtor;
    813802                        ctorInit->dtor = nullptr;
    814803                }
Note: See TracChangeset for help on using the changeset viewer.