Changeset 68f9c43 for src/SynTree


Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (8 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

Location:
src/SynTree
Files:
2 added
39 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/AddressExpr.cc

    r6171841 r68f9c43  
    5858}
    5959
    60 AddressExpr::~AddressExpr() {
    61         delete arg;
    62 }
    63 
    6460void AddressExpr::print( std::ostream &os, Indenter indent ) const {
    6561        os << "Address of:" << std::endl;
     
    7571}
    7672LabelAddressExpr::LabelAddressExpr( const LabelAddressExpr & other ) : Expression( other ), arg( other.arg ) {}
    77 LabelAddressExpr::~LabelAddressExpr() {}
    7873
    7974void LabelAddressExpr::print( std::ostream & os, Indenter ) const {
  • src/SynTree/AggregateDecl.cc

    r6171841 r68f9c43  
    3333        cloneAll( other.attributes, attributes );
    3434        body = other.body;
    35 }
    36 
    37 AggregateDecl::~AggregateDecl() {
    38         deleteAll( attributes );
    39         deleteAll( parameters );
    40         deleteAll( members );
    4135}
    4236
  • src/SynTree/ApplicationExpr.cc

    r6171841 r68f9c43  
    4343}
    4444
    45 ParamEntry::~ParamEntry() {
    46         delete actualType;
    47         delete formalType;
    48         delete expr;
    49 }
    50 
    5145ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) {
    5246        PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() );
     
    6155                Expression( other ), function( maybeClone( other.function ) ) {
    6256        cloneAll( other.args, args );
    63 }
    64 
    65 ApplicationExpr::~ApplicationExpr() {
    66         delete function;
    67         deleteAll( args );
    6857}
    6958
  • src/SynTree/ArrayType.cc

    r6171841 r68f9c43  
    3434}
    3535
    36 ArrayType::~ArrayType() {
    37         delete base;
    38         delete dimension;
    39 }
    40 
    4136void ArrayType::print( std::ostream &os, Indenter indent ) const {
    4237        Type::print( os, indent );
  • src/SynTree/AttrType.cc

    r6171841 r68f9c43  
    3737}
    3838
    39 AttrType::~AttrType() {
    40         delete expr;
    41         delete type;
    42 }
    43 
    4439void AttrType::print( std::ostream &os, Indenter indent ) const {
    4540        Type::print( os, indent );
  • src/SynTree/Attribute.cc

    r6171841 r68f9c43  
    2323Attribute::Attribute( const Attribute &other ) : name( other.name ) {
    2424        cloneAll( other.parameters, parameters );
    25 }
    26 
    27 Attribute::~Attribute() {
    28         deleteAll( parameters );
    2925}
    3026
  • src/SynTree/Attribute.h

    r6171841 r68f9c43  
    3636        Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {}
    3737        Attribute( const Attribute &other );
    38         virtual ~Attribute();
    3938
    4039        std::string get_name() const { return name; }
  • src/SynTree/BaseSyntaxNode.h

    r6171841 r68f9c43  
    1717
    1818#include "Common/CodeLocation.h"
     19#include "Common/GC.h"
    1920#include "Common/Indenter.h"
     21
    2022class Visitor;
    2123class Mutator;
    2224
    23 class BaseSyntaxNode {
    24   public:
     25class BaseSyntaxNode : GC_Object {
     26public:
    2527        CodeLocation location;
    26 
    27         virtual ~BaseSyntaxNode() {}
    2828
    2929        virtual BaseSyntaxNode * clone() const = 0;
  • src/SynTree/CommaExpr.cc

    r6171841 r68f9c43  
    3434}
    3535
    36 CommaExpr::~CommaExpr() {
    37         delete arg1;
    38         delete arg2;
    39 }
    40 
    4136void CommaExpr::print( std::ostream &os, Indenter indent ) const {
    4237        os << "Comma Expression:" << std::endl;
  • src/SynTree/CompoundStmt.cc

    r6171841 r68f9c43  
    6868}
    6969
    70 CompoundStmt::~CompoundStmt() {
    71         deleteAll( kids );
    72 }
    73 
    7470void CompoundStmt::print( std::ostream &os, Indenter indent ) const {
    7571        os << "CompoundStmt" << endl;
  • src/SynTree/Constant.cc

    r6171841 r68f9c43  
    2727        type = other.type->clone();
    2828}
    29 
    30 Constant::~Constant() { delete type; }
    3129
    3230Constant Constant::from_bool( bool b ) {
  • src/SynTree/Constant.h

    r6171841 r68f9c43  
    3030        Constant( Type * type, std::string rep, double val );
    3131        Constant( const Constant & other );
    32         virtual ~Constant();
    33 
     32       
    3433        virtual Constant * clone() const { return new Constant( *this ); }
    3534
  • src/SynTree/DeclStmt.cc

    r6171841 r68f9c43  
    2929}
    3030
    31 DeclStmt::~DeclStmt() {
    32         delete decl;
    33 }
    34 
    3531void DeclStmt::print( std::ostream &os, Indenter indent ) const {
    3632        assert( decl != 0 );
  • src/SynTree/Declaration.cc

    r6171841 r68f9c43  
    3838}
    3939
    40 Declaration::~Declaration() {
    41 }
    42 
    4340void Declaration::fixUniqueId() {
    4441        // don't need to set unique ID twice
     
    6865}
    6966
    70 AsmDecl::~AsmDecl() {
    71         delete stmt;
    72 }
    73 
    7467void AsmDecl::print( std::ostream &os, Indenter indent ) const {
    7568        stmt->print( os, indent );
  • src/SynTree/Declaration.h

    r6171841 r68f9c43  
    4545        Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
    4646        Declaration( const Declaration &other );
    47         virtual ~Declaration();
    4847
    4948        const std::string &get_name() const { return name; }
     
    8786        DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
    8887        DeclarationWithType( const DeclarationWithType &other );
    89         virtual ~DeclarationWithType();
    90 
     88       
    9189        std::string get_mangleName() const { return mangleName; }
    9290        DeclarationWithType * set_mangleName( std::string newValue ) { mangleName = newValue; return this; }
     
    126124                                const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    127125        ObjectDecl( const ObjectDecl &other );
    128         virtual ~ObjectDecl();
    129126
    130127        virtual Type * get_type() const override { return type; }
     
    156153                                  const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    157154        FunctionDecl( const FunctionDecl &other );
    158         virtual ~FunctionDecl();
    159155
    160156        virtual Type * get_type() const override { return type; }
     
    184180        NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type );
    185181        NamedTypeDecl( const NamedTypeDecl &other );
    186         virtual ~NamedTypeDecl();
    187182
    188183        Type *get_base() const { return base; }
     
    219214        TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr );
    220215        TypeDecl( const TypeDecl &other );
    221         virtual ~TypeDecl();
    222216
    223217        Kind get_kind() const { return kind; }
     
    268262        AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
    269263        AggregateDecl( const AggregateDecl &other );
    270         virtual ~AggregateDecl();
    271 
     264       
    272265        std::list<Declaration*>& get_members() { return members; }
    273266        std::list<TypeDecl*>& get_parameters() { return parameters; }
     
    353346        AsmDecl( AsmStmt *stmt );
    354347        AsmDecl( const AsmDecl &other );
    355         virtual ~AsmDecl();
    356348
    357349        AsmStmt *get_stmt() { return stmt; }
  • src/SynTree/DeclarationWithType.cc

    r6171841 r68f9c43  
    3434}
    3535
    36 DeclarationWithType::~DeclarationWithType() {
    37         deleteAll( attributes );
    38         delete asmName;
    39 }
    40 
    4136// Local Variables: //
    4237// tab-width: 4 //
  • src/SynTree/Expression.cc

    r6171841 r68f9c43  
    5252Expression::~Expression() {
    5353        delete env;
    54         delete result;
    5554}
    5655
     
    7473ConstantExpr::ConstantExpr( const ConstantExpr &other) : Expression( other ), constant( other.constant ) {
    7574}
    76 
    77 ConstantExpr::~ConstantExpr() {}
    7875
    7976void ConstantExpr::print( std::ostream &os, Indenter indent ) const {
     
    120117}
    121118
    122 VariableExpr::~VariableExpr() {
    123         // don't delete the declaration, since it points somewhere else in the tree
    124 }
    125 
    126119VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {
    127120        VariableExpr * funcExpr = new VariableExpr( func );
     
    150143}
    151144
    152 SizeofExpr::~SizeofExpr() {
    153         delete expr;
    154         delete type;
    155 }
    156 
    157145void SizeofExpr::print( std::ostream &os, Indenter indent) const {
    158146        os << "Sizeof Expression on: ";
     
    176164}
    177165
    178 AlignofExpr::~AlignofExpr() {
    179         delete expr;
    180         delete type;
    181 }
    182 
    183166void AlignofExpr::print( std::ostream &os, Indenter indent) const {
    184167        os << "Alignof Expression on: ";
     
    196179UntypedOffsetofExpr::UntypedOffsetofExpr( const UntypedOffsetofExpr &other ) :
    197180        Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {}
    198 
    199 UntypedOffsetofExpr::~UntypedOffsetofExpr() {
    200         delete type;
    201 }
    202181
    203182void UntypedOffsetofExpr::print( std::ostream &os, Indenter indent) const {
     
    217196        Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {}
    218197
    219 OffsetofExpr::~OffsetofExpr() {
    220         delete type;
    221 }
    222 
    223198void OffsetofExpr::print( std::ostream &os, Indenter indent) const {
    224199        os << "Offsetof Expression on member " << member->name << " of ";
     
    234209OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) {}
    235210
    236 OffsetPackExpr::~OffsetPackExpr() { delete type; }
    237 
    238211void OffsetPackExpr::print( std::ostream &os, Indenter indent ) const {
    239212        os << "Offset pack expression on ";
     
    252225AttrExpr::AttrExpr( const AttrExpr &other ) :
    253226                Expression( other ), attr( maybeClone( other.attr ) ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) {
    254 }
    255 
    256 AttrExpr::~AttrExpr() {
    257         delete attr;
    258         delete expr;
    259         delete type;
    260227}
    261228
     
    280247
    281248CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {
    282 }
    283 
    284 CastExpr::~CastExpr() {
    285         delete arg;
    286249}
    287250
     
    306269}
    307270
    308 VirtualCastExpr::~VirtualCastExpr() {
    309         delete arg;
    310 }
    311 
    312271void VirtualCastExpr::print( std::ostream &os, Indenter indent ) const {
    313272        os << "Virtual Cast of:" << std::endl << indent+1;
     
    332291}
    333292
    334 UntypedMemberExpr::~UntypedMemberExpr() {
    335         delete aggregate;
    336         delete member;
    337 }
    338 
    339293void UntypedMemberExpr::print( std::ostream &os, Indenter indent ) const {
    340294        os << "Untyped Member Expression, with field: " << std::endl << indent+1;
     
    363317}
    364318
    365 MemberExpr::~MemberExpr() {
    366         // don't delete the member declaration, since it points somewhere else in the tree
    367         delete aggregate;
    368 }
    369 
    370319void MemberExpr::print( std::ostream &os, Indenter indent ) const {
    371320        os << "Member Expression, with field: " << std::endl;
     
    383332                Expression( other ), function( maybeClone( other.function ) ) {
    384333        cloneAll( other.args, args );
    385 }
    386 
    387 UntypedExpr::~UntypedExpr() {
    388         delete function;
    389         deleteAll( args );
    390334}
    391335
     
    436380}
    437381
    438 NameExpr::~NameExpr() {}
    439 
    440382void NameExpr::print( std::ostream &os, Indenter indent ) const {
    441383        os << "Name: " << get_name();
     
    450392LogicalExpr::LogicalExpr( const LogicalExpr &other ) :
    451393                Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), isAnd( other.isAnd ) {
    452 }
    453 
    454 LogicalExpr::~LogicalExpr() {
    455         delete arg1;
    456         delete arg2;
    457394}
    458395
     
    470407ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) :
    471408                Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), arg3( maybeClone( other.arg3 ) ) {
    472 }
    473 
    474 ConditionalExpr::~ConditionalExpr() {
    475         delete arg1;
    476         delete arg2;
    477         delete arg3;
    478409}
    479410
     
    513444ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
    514445        set_env( nullptr ); // ImplicitCopyCtorExpr does not take ownership of an environment
    515         delete callExpr;
    516         deleteAll( tempDecls );
    517         deleteAll( returnDecls );
    518         deleteAll( dtors );
    519446}
    520447
     
    541468}
    542469
    543 ConstructorExpr::~ConstructorExpr() {
    544         delete callExpr;
    545 }
    546 
    547470void ConstructorExpr::print( std::ostream &os, Indenter indent ) const {
    548471        os <<  "Constructor Expression: " << std::endl << indent+1;
     
    559482
    560483CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), initializer( other.initializer->clone() ) {}
    561 
    562 CompoundLiteralExpr::~CompoundLiteralExpr() {
    563         delete initializer;
    564 }
    565484
    566485void CompoundLiteralExpr::print( std::ostream &os, Indenter indent ) const {
     
    589508        cloneAll( other.dtors, dtors );
    590509}
    591 StmtExpr::~StmtExpr() {
    592         delete statements;
    593         deleteAll( dtors );
    594         deleteAll( returnDecls );
    595 }
    596510void StmtExpr::computeResult() {
    597511        assert( statements );
    598512        std::list< Statement * > & body = statements->kids;
    599         delete result;
    600513        result = nullptr;
    601514        if ( ! returnDecls.empty() ) {
     
    640553UniqueExpr::UniqueExpr( const UniqueExpr &other ) : Expression( other ), expr( maybeClone( other.expr ) ), object( maybeClone( other.object ) ), var( maybeClone( other.var ) ), id( other.id ) {
    641554}
    642 UniqueExpr::~UniqueExpr() {
    643         delete expr;
    644         delete object;
    645         delete var;
    646 }
     555
    647556void UniqueExpr::print( std::ostream &os, Indenter indent ) const {
    648557        os << "Unique Expression with id:" << id << std::endl << indent+1;
     
    657566InitAlternative::InitAlternative( Type * type, Designation * designation ) : type( type ), designation( designation ) {}
    658567InitAlternative::InitAlternative( const InitAlternative & other ) : type( maybeClone( other.type ) ), designation( maybeClone( other.designation ) ) {}
    659 InitAlternative::~InitAlternative() {
    660         delete type;
    661         delete designation;
    662 }
    663568
    664569UntypedInitExpr::UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts ) : expr( expr ), initAlts( initAlts ) {}
    665570UntypedInitExpr::UntypedInitExpr( const UntypedInitExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), initAlts( other.initAlts ) {}
    666 UntypedInitExpr::~UntypedInitExpr() {
    667         delete expr;
    668 }
    669571
    670572void UntypedInitExpr::print( std::ostream & os, Indenter indent ) const {
     
    684586}
    685587InitExpr::InitExpr( const InitExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), designation( maybeClone( other.designation) ) {}
    686 InitExpr::~InitExpr() {
    687         delete expr;
    688         delete designation;
    689 }
    690588
    691589void InitExpr::print( std::ostream & os, Indenter indent ) const {
     
    701599}
    702600DeletedExpr::DeletedExpr( const DeletedExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), deleteStmt( other.deleteStmt ) {}
    703 DeletedExpr::~DeletedExpr() {
    704         delete expr;
    705 }
    706601
    707602void DeletedExpr::print( std::ostream & os, Indenter indent ) const {
  • src/SynTree/Expression.h

    r6171841 r68f9c43  
    4141        ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
    4242        ParamEntry( const ParamEntry & other );
    43         ~ParamEntry();
    4443        ParamEntry & operator=( const ParamEntry & other );
    4544
     
    5352/// Expression is the root type for all expressions
    5453class Expression : public BaseSyntaxNode {
     54  protected:
     55        virtual ~Expression();
     56
    5557  public:
    5658        Type * result;
     
    6163        Expression();
    6264        Expression( const Expression & other );
    63         virtual ~Expression();
    6465
    6566        Type *& get_result() { return result; }
     
    8990        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    9091        ApplicationExpr( const ApplicationExpr & other );
    91         virtual ~ApplicationExpr();
    9292
    9393        Expression * get_function() const { return function; }
     
    111111        UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    112112        UntypedExpr( const UntypedExpr & other );
    113         virtual ~UntypedExpr();
    114113
    115114        Expression * get_function() const { return function; }
     
    136135        NameExpr( std::string name );
    137136        NameExpr( const NameExpr & other );
    138         virtual ~NameExpr();
    139137
    140138        const std::string & get_name() const { return name; }
     
    157155        AddressExpr( Expression * arg );
    158156        AddressExpr( const AddressExpr & other );
    159         virtual ~AddressExpr();
    160157
    161158        Expression * get_arg() const { return arg; }
     
    176173        LabelAddressExpr( const Label &arg );
    177174        LabelAddressExpr( const LabelAddressExpr & other );
    178         virtual ~LabelAddressExpr();
    179175
    180176        virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); }
     
    192188        CastExpr( Expression * arg, Type * toType );
    193189        CastExpr( const CastExpr & other );
    194         virtual ~CastExpr();
    195190
    196191        Expression * get_arg() const { return arg; }
     
    210205        VirtualCastExpr( Expression * arg, Type * toType );
    211206        VirtualCastExpr( const VirtualCastExpr & other );
    212         virtual ~VirtualCastExpr();
    213207
    214208        Expression * get_arg() const { return arg; }
     
    229223        UntypedMemberExpr( Expression * member, Expression * aggregate );
    230224        UntypedMemberExpr( const UntypedMemberExpr & other );
    231         virtual ~UntypedMemberExpr();
    232225
    233226        Expression * get_member() const { return member; }
     
    251244        MemberExpr( DeclarationWithType * member, Expression * aggregate );
    252245        MemberExpr( const MemberExpr & other );
    253         virtual ~MemberExpr();
    254246
    255247        DeclarationWithType * get_member() const { return member; }
     
    272264        VariableExpr( DeclarationWithType * var );
    273265        VariableExpr( const VariableExpr & other );
    274         virtual ~VariableExpr();
    275266
    276267        DeclarationWithType * get_var() const { return var; }
     
    292283        ConstantExpr( Constant constant );
    293284        ConstantExpr( const ConstantExpr & other );
    294         virtual ~ConstantExpr();
    295285
    296286        Constant * get_constant() { return & constant; }
     
    316306        SizeofExpr( const SizeofExpr & other );
    317307        SizeofExpr( Type * type );
    318         virtual ~SizeofExpr();
    319308
    320309        Expression * get_expr() const { return expr; }
     
    341330        AlignofExpr( const AlignofExpr & other );
    342331        AlignofExpr( Type * type );
    343         virtual ~AlignofExpr();
    344332
    345333        Expression * get_expr() const { return expr; }
     
    364352        UntypedOffsetofExpr( Type * type, const std::string & member );
    365353        UntypedOffsetofExpr( const UntypedOffsetofExpr & other );
    366         virtual ~UntypedOffsetofExpr();
    367354
    368355        std::string get_member() const { return member; }
     
    385372        OffsetofExpr( Type * type, DeclarationWithType * member );
    386373        OffsetofExpr( const OffsetofExpr & other );
    387         virtual ~OffsetofExpr();
    388374
    389375        Type * get_type() const { return type; }
     
    405391        OffsetPackExpr( StructInstType * type );
    406392        OffsetPackExpr( const OffsetPackExpr & other );
    407         virtual ~OffsetPackExpr();
    408393
    409394        StructInstType * get_type() const { return type; }
     
    427412        AttrExpr( const AttrExpr & other );
    428413        AttrExpr( Expression * attr, Type * type );
    429         virtual ~AttrExpr();
    430414
    431415        Expression * get_attr() const { return attr; }
     
    452436        LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true );
    453437        LogicalExpr( const LogicalExpr & other );
    454         virtual ~LogicalExpr();
    455438
    456439        bool get_isAnd() const { return isAnd; }
     
    478461        ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 );
    479462        ConditionalExpr( const ConditionalExpr & other );
    480         virtual ~ConditionalExpr();
    481463
    482464        Expression * get_arg1() const { return arg1; }
     
    501483        CommaExpr( Expression * arg1, Expression * arg2 );
    502484        CommaExpr( const CommaExpr & other );
    503         virtual ~CommaExpr();
    504485
    505486        Expression * get_arg1() const { return arg1; }
     
    521502        TypeExpr( Type * type );
    522503        TypeExpr( const TypeExpr & other );
    523         virtual ~TypeExpr();
    524504
    525505        Type * get_type() const { return type; }
     
    541521        AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
    542522        AsmExpr( const AsmExpr & other );
    543         virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
    544523
    545524        Expression * get_inout() const { return inout; }
     
    563542/// along with a set of copy constructor calls, one for each argument.
    564543class ImplicitCopyCtorExpr : public Expression {
     544protected:
     545        virtual ~ImplicitCopyCtorExpr();
     546
    565547public:
    566548        ApplicationExpr * callExpr;
     
    571553        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
    572554        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
    573         virtual ~ImplicitCopyCtorExpr();
    574555
    575556        ApplicationExpr * get_callExpr() const { return callExpr; }
     
    593574        ConstructorExpr( Expression * callExpr );
    594575        ConstructorExpr( const ConstructorExpr & other );
    595         ~ConstructorExpr();
    596576
    597577        Expression * get_callExpr() const { return callExpr; }
     
    611591        CompoundLiteralExpr( Type * type, Initializer * initializer );
    612592        CompoundLiteralExpr( const CompoundLiteralExpr & other );
    613         virtual ~CompoundLiteralExpr();
    614593
    615594        Initializer * get_initializer() const { return initializer; }
     
    648627        UntypedTupleExpr( const std::list< Expression * > & exprs );
    649628        UntypedTupleExpr( const UntypedTupleExpr & other );
    650         virtual ~UntypedTupleExpr();
    651629
    652630        std::list<Expression*>& get_exprs() { return exprs; }
     
    665643        TupleExpr( const std::list< Expression * > & exprs );
    666644        TupleExpr( const TupleExpr & other );
    667         virtual ~TupleExpr();
    668645
    669646        std::list<Expression*>& get_exprs() { return exprs; }
     
    683660        TupleIndexExpr( Expression * tuple, unsigned int index );
    684661        TupleIndexExpr( const TupleIndexExpr & other );
    685         virtual ~TupleIndexExpr();
    686662
    687663        Expression * get_tuple() const { return tuple; }
     
    703679        TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls );
    704680        TupleAssignExpr( const TupleAssignExpr & other );
    705         virtual ~TupleAssignExpr();
    706681
    707682        TupleAssignExpr * set_stmtExpr( StmtExpr * newValue ) { stmtExpr = newValue; return this; }
     
    723698        StmtExpr( CompoundStmt * statements );
    724699        StmtExpr( const StmtExpr & other );
    725         virtual ~StmtExpr();
    726700
    727701        CompoundStmt * get_statements() const { return statements; }
     
    748722        UniqueExpr( Expression * expr, long long idVal = -1 );
    749723        UniqueExpr( const UniqueExpr & other );
    750         ~UniqueExpr();
    751724
    752725        Expression * get_expr() const { return expr; }
     
    778751        InitAlternative( const InitAlternative & other );
    779752        InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it
    780         ~InitAlternative();
    781753};
    782754
     
    788760        UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts );
    789761        UntypedInitExpr( const UntypedInitExpr & other );
    790         ~UntypedInitExpr();
    791762
    792763        Expression * get_expr() const { return expr; }
     
    808779        InitExpr( Expression * expr, Designation * designation );
    809780        InitExpr( const InitExpr & other );
    810         ~InitExpr();
    811781
    812782        Expression * get_expr() const { return expr; }
     
    830800        DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt );
    831801        DeletedExpr( const DeletedExpr & other );
    832         ~DeletedExpr();
    833802
    834803        virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); }
  • src/SynTree/FunctionDecl.cc

    r6171841 r68f9c43  
    5252        }
    5353        cloneAll( other.withExprs, withExprs );
    54 }
    55 
    56 FunctionDecl::~FunctionDecl() {
    57         delete type;
    58         delete statements;
    59         deleteAll( withExprs );
    6054}
    6155
  • src/SynTree/FunctionType.cc

    r6171841 r68f9c43  
    3131        cloneAll( other.returnVals, returnVals );
    3232        cloneAll( other.parameters, parameters );
    33 }
    34 
    35 FunctionType::~FunctionType() {
    36         deleteAll( returnVals );
    37         deleteAll( parameters );
    3833}
    3934
  • src/SynTree/Initializer.cc

    r6171841 r68f9c43  
    3232}
    3333
    34 Designation::~Designation() {
    35         // std::cerr << "destroying designation" << std::endl;
    36         deleteAll( designators );
    37         // std::cerr << "finished destroying designation" << std::endl;
    38 }
    39 
    4034void Designation::print( std::ostream &os, Indenter indent ) const {
    4135        if ( ! designators.empty() ) {
     
    5246Initializer::Initializer( const Initializer & other ) : BaseSyntaxNode( other ), maybeConstructed( other.maybeConstructed ) {
    5347}
    54 Initializer::~Initializer() {}
    5548
    5649SingleInit::SingleInit( Expression *v, bool maybeConstructed ) : Initializer( maybeConstructed ), value ( v ) {
     
    5851
    5952SingleInit::SingleInit( const SingleInit &other ) : Initializer(other), value ( maybeClone( other.value ) ) {
    60 }
    61 
    62 SingleInit::~SingleInit() {
    63         delete value;
    6453}
    6554
     
    8776}
    8877
    89 ListInit::~ListInit() {
    90         deleteAll( initializers );
    91         deleteAll( designations );
    92 }
    93 
    9478void ListInit::print( std::ostream &os, Indenter indent ) const {
    9579        os << "Compound initializer: " << std::endl;
     
    11094ConstructorInit::ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ) : Initializer( true ), ctor( ctor ), dtor( dtor ), init( init ) {}
    11195ConstructorInit::ConstructorInit( const ConstructorInit &other ) : Initializer( other ), ctor( maybeClone( other.ctor ) ), dtor( maybeClone( other.dtor ) ), init( maybeClone( other.init ) ) {
    112 }
    113 
    114 ConstructorInit::~ConstructorInit() {
    115         delete ctor;
    116         delete dtor;
    117         delete init;
    11896}
    11997
  • src/SynTree/Initializer.h

    r6171841 r68f9c43  
    3333        Designation( const std::list< Expression * > & designators );
    3434        Designation( const Designation & other );
    35         virtual ~Designation();
    3635
    3736        std::list< Expression * > & get_designators() { return designators; }
     
    5049        Initializer( bool maybeConstructed );
    5150        Initializer( const Initializer & other );
    52         virtual ~Initializer();
    5351
    5452        bool get_maybeConstructed() { return maybeConstructed; }
     
    7068        SingleInit( Expression *value, bool maybeConstructed = false );
    7169        SingleInit( const SingleInit &other );
    72         virtual ~SingleInit();
    7370
    7471        Expression *get_value() { return value; }
     
    9188                          const std::list<Designation *> &designators = {}, bool maybeConstructed = false );
    9289        ListInit( const ListInit & other );
    93         virtual ~ListInit();
    9490
    9591        std::list<Designation *> & get_designations() { return designations; }
     
    123119        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
    124120        ConstructorInit( const ConstructorInit &other );
    125         virtual ~ConstructorInit();
    126121
    127122        void set_ctor( Statement * newValue ) { ctor = newValue; }
  • src/SynTree/NamedTypeDecl.cc

    r6171841 r68f9c43  
    3030        cloneAll( other.parameters, parameters );
    3131        cloneAll( other.assertions, assertions );
    32 }
    33 
    34 NamedTypeDecl::~NamedTypeDecl() {
    35         delete base;
    36         deleteAll( parameters );
    37         deleteAll( assertions );
    3832}
    3933
  • src/SynTree/ObjectDecl.cc

    r6171841 r68f9c43  
    3232ObjectDecl::ObjectDecl( const ObjectDecl &other )
    3333        : Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ) {
    34 }
    35 
    36 ObjectDecl::~ObjectDecl() {
    37         delete type;
    38         delete init;
    39         delete bitfieldWidth;
    4034}
    4135
  • src/SynTree/PointerType.cc

    r6171841 r68f9c43  
    3636}
    3737
    38 PointerType::~PointerType() {
    39         delete base;
    40         delete dimension;
    41 }
    42 
    4338void PointerType::print( std::ostream &os, Indenter indent ) const {
    4439        Type::print( os, indent );
  • src/SynTree/ReferenceToType.cc

    r6171841 r68f9c43  
    3232ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ), hoistType( other.hoistType ) {
    3333        cloneAll( other.parameters, parameters );
    34 }
    35 
    36 ReferenceToType::~ReferenceToType() {
    37         deleteAll( parameters );
    3834}
    3935
     
    170166}
    171167
    172 TraitInstType::~TraitInstType() {
    173 }
    174 
    175168bool TraitInstType::isComplete() const { assert( false ); }
    176169
     
    183176
    184177TypeInstType::TypeInstType( const TypeInstType &other ) : Parent( other ), baseType( other.baseType ), isFtype( other.isFtype ) {
    185 }
    186 
    187 
    188 TypeInstType::~TypeInstType() {
    189         // delete baseType; //This is shared and should not be deleted
    190178}
    191179
  • src/SynTree/ReferenceType.cc

    r6171841 r68f9c43  
    2828}
    2929
    30 ReferenceType::~ReferenceType() {
    31         delete base;
    32 }
    33 
    3430int ReferenceType::referenceDepth() const {
    3531        return base->referenceDepth()+1;
  • 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;
  • src/SynTree/Statement.h

    r6171841 r68f9c43  
    3838
    3939        Statement( const std::list<Label> & labels = {} );
    40         virtual ~Statement();
    4140
    4241        std::list<Label> & get_labels() { return labels; }
     
    5655        CompoundStmt( std::list<Statement *> stmts );
    5756        CompoundStmt( const CompoundStmt &other );
    58         virtual ~CompoundStmt();
    5957
    6058        std::list<Statement*>& get_kids() { return kids; }
     
    8482        ExprStmt( Expression *expr );
    8583        ExprStmt( const ExprStmt &other );
    86         virtual ~ExprStmt();
    8784
    8885        Expression *get_expr() { return expr; }
     
    105102        AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );
    106103        AsmStmt( const AsmStmt &other );
    107         virtual ~AsmStmt();
    108104
    109105        bool get_voltile() { return voltile; }
     
    136132                        std::list<Statement *> initialization = std::list<Statement *>() );
    137133        IfStmt( const IfStmt &other );
    138         virtual ~IfStmt();
    139134
    140135        std::list<Statement *> &get_initialization() { return initialization; }
     
    159154        SwitchStmt( Expression *condition, const std::list<Statement *> &statements );
    160155        SwitchStmt( const SwitchStmt &other );
    161         virtual ~SwitchStmt();
    162156
    163157        Expression *get_condition() { return condition; }
     
    181175        CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException);
    182176        CaseStmt( const CaseStmt &other );
    183         virtual ~CaseStmt();
    184177
    185178        static CaseStmt * makeDefault( const std::list<Label> & labels = {}, std::list<Statement *> stmts = std::list<Statement *>() );
     
    212205               Statement *body, bool isDoWhile = false );
    213206        WhileStmt( const WhileStmt &other );
    214         virtual ~WhileStmt();
    215207
    216208        Expression *get_condition() { return condition; }
     
    237229             Expression *condition = 0, Expression *increment = 0, Statement *body = 0 );
    238230        ForStmt( const ForStmt &other );
    239         virtual ~ForStmt();
    240231
    241232        std::list<Statement *> &get_initialization() { return initialization; }
     
    290281        ReturnStmt( Expression *expr );
    291282        ReturnStmt( const ReturnStmt &other );
    292         virtual ~ReturnStmt();
    293283
    294284        Expression *get_expr() { return expr; }
     
    311301        ThrowStmt( Kind kind, Expression * expr, Expression * target = nullptr );
    312302        ThrowStmt( const ThrowStmt &other );
    313         virtual ~ThrowStmt();
    314303
    315304        Kind get_kind() { return kind; }
     
    333322        TryStmt( CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
    334323        TryStmt( const TryStmt &other );
    335         virtual ~TryStmt();
    336324
    337325        CompoundStmt *get_block() const { return block; }
     
    360348                   Expression *cond, Statement *body );
    361349        CatchStmt( const CatchStmt &other );
    362         virtual ~CatchStmt();
    363350
    364351        Kind get_kind() { return kind; }
     
    382369        FinallyStmt( CompoundStmt *block );
    383370        FinallyStmt( const FinallyStmt &other );
    384         virtual ~FinallyStmt();
    385371
    386372        CompoundStmt *get_block() const { return block; }
     
    409395        WaitForStmt();
    410396        WaitForStmt( const WaitForStmt & );
    411         virtual ~WaitForStmt();
    412397
    413398        std::vector<Clause> clauses;
     
    438423        WithStmt( const std::list< Expression * > & exprs, Statement * stmt );
    439424        WithStmt( const WithStmt & other );
    440         virtual ~WithStmt();
    441425
    442426        virtual WithStmt * clone() const override { return new WithStmt( *this ); }
     
    454438        DeclStmt( Declaration *decl );
    455439        DeclStmt( const DeclStmt &other );
    456         virtual ~DeclStmt();
    457440
    458441        Declaration *get_decl() const { return decl; }
     
    476459        ImplicitCtorDtorStmt( Statement * callStmt );
    477460        ImplicitCtorDtorStmt( const ImplicitCtorDtorStmt & other );
    478         virtual ~ImplicitCtorDtorStmt();
    479461
    480462        Statement *get_callStmt() const { return callStmt; }
  • src/SynTree/TupleExpr.cc

    r6171841 r68f9c43  
    3535}
    3636
    37 UntypedTupleExpr::~UntypedTupleExpr() {
    38         deleteAll( exprs );
    39 }
    40 
    4137void UntypedTupleExpr::print( std::ostream &os, Indenter indent ) const {
    4238        os << "Untyped Tuple:" << std::endl;
     
    5147TupleExpr::TupleExpr( const TupleExpr &other ) : Expression( other ) {
    5248        cloneAll( other.exprs, exprs );
    53 }
    54 
    55 TupleExpr::~TupleExpr() {
    56         deleteAll( exprs );
    5749}
    5850
     
    7264
    7365TupleIndexExpr::TupleIndexExpr( const TupleIndexExpr &other ) : Expression( other ), tuple( other.tuple->clone() ), index( other.index ) {
    74 }
    75 
    76 TupleIndexExpr::~TupleIndexExpr() {
    77         delete tuple;
    7866}
    7967
     
    10593}
    10694
    107 TupleAssignExpr::~TupleAssignExpr() {
    108         delete stmtExpr;
    109 }
    110 
    11195void TupleAssignExpr::print( std::ostream &os, Indenter indent ) const {
    11296        os << "Tuple Assignment Expression, with stmt expr:" << std::endl;
  • src/SynTree/TupleType.cc

    r6171841 r68f9c43  
    4343}
    4444
    45 TupleType::~TupleType() {
    46         deleteAll( types );
    47         deleteAll( members );
    48 }
    49 
    5045void TupleType::print( std::ostream &os, Indenter indent ) const {
    5146        Type::print( os, indent );
  • src/SynTree/Type.cc

    r6171841 r68f9c43  
    5757}
    5858
    59 Type::~Type() {
    60         deleteAll( forall );
    61         deleteAll( attributes );
    62 }
    63 
    6459// These must remain in the same order as the corresponding bit fields.
    6560const char * Type::FuncSpecifiersNames[] = { "inline", "fortran", "_Noreturn" };
  • src/SynTree/Type.h

    r6171841 r68f9c43  
    141141        Type( const Qualifiers & tq, const std::list< Attribute * > & attributes );
    142142        Type( const Type & other );
    143         virtual ~Type();
    144143
    145144        Qualifiers & get_qualifiers() { return tq; }
     
    261260        PointerType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    262261        PointerType( const PointerType& );
    263         virtual ~PointerType();
    264262
    265263        Type *get_base() { return base; }
     
    291289        ArrayType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    292290        ArrayType( const ArrayType& );
    293         virtual ~ArrayType();
    294291
    295292        Type *get_base() { return base; }
     
    319316        ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    320317        ReferenceType( const ReferenceType & );
    321         virtual ~ReferenceType();
    322318
    323319        Type *get_base() { return base; }
     
    352348        FunctionType( const Type::Qualifiers & tq, bool isVarArgs, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    353349        FunctionType( const FunctionType& );
    354         virtual ~FunctionType();
    355350
    356351        std::list<DeclarationWithType*> & get_returnVals() { return returnVals; }
     
    376371        ReferenceToType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes );
    377372        ReferenceToType( const ReferenceToType & other );
    378         virtual ~ReferenceToType();
    379373
    380374        const std::string & get_name() const { return name; }
     
    503497        TraitInstType( const Type::Qualifiers & tq, TraitDecl * baseTrait, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    504498        TraitInstType( const TraitInstType & other );
    505         ~TraitInstType();
    506499
    507500        virtual bool isComplete() const override;
     
    525518        TypeInstType( const Type::Qualifiers & tq, const std::string & name, bool isFtype, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    526519        TypeInstType( const TypeInstType & other );
    527         ~TypeInstType();
    528520
    529521        TypeDecl *get_baseType() const { return baseType; }
     
    549541        TupleType( const Type::Qualifiers & tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    550542        TupleType( const TupleType& );
    551         virtual ~TupleType();
    552543
    553544        typedef std::list<Type*> value_type;
     
    583574        TypeofType( const Type::Qualifiers & tq, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    584575        TypeofType( const TypeofType& );
    585         virtual ~TypeofType();
    586576
    587577        Expression *get_expr() const { return expr; }
     
    606596        AttrType( const Type::Qualifiers & tq, const std::string & name, Type *type, const std::list< Attribute * > & attributes = std::list< Attribute * >()  );
    607597        AttrType( const AttrType& );
    608         virtual ~AttrType();
    609598
    610599        const std::string & get_name() const { return name; }
  • src/SynTree/TypeDecl.cc

    r6171841 r68f9c43  
    2525
    2626TypeDecl::TypeDecl( const TypeDecl &other ) : Parent( other ), init( maybeClone( other.init ) ), sized( other.sized ), kind( other.kind ) {
    27 }
    28 
    29 TypeDecl::~TypeDecl() {
    30   delete init;
    3127}
    3228
  • src/SynTree/TypeExpr.cc

    r6171841 r68f9c43  
    2626}
    2727
    28 TypeExpr::~TypeExpr() {
    29         delete type;
    30 }
    31 
    3228void TypeExpr::print( std::ostream &os, Indenter indent ) const {
    3329        if ( type ) type->print( os, indent );
  • src/SynTree/TypeSubstitution.cc

    r6171841 r68f9c43  
    2626}
    2727
    28 TypeSubstitution::~TypeSubstitution() {
    29         for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    30                 delete( i->second );
    31         }
    32         for ( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    33                 delete( i->second );
    34         }
    35 }
    36 
    3728TypeSubstitution &TypeSubstitution::operator=( const TypeSubstitution &other ) {
    3829        if ( this == &other ) return *this;
     
    5748
    5849void TypeSubstitution::add( std::string formalType, Type *actualType ) {
    59         TypeEnvType::iterator i = typeEnv.find( formalType );
    60         if ( i != typeEnv.end() ) {
    61                 delete i->second;
    62         } // if
    6350        typeEnv[ formalType ] = actualType->clone();
    6451}
    6552
    6653void TypeSubstitution::remove( std::string formalType ) {
    67         TypeEnvType::iterator i = typeEnv.find( formalType );
    68         if ( i != typeEnv.end() ) {
    69                 delete i->second;
    70                 typeEnv.erase( formalType );
    71         } // if
     54        typeEnv.erase( formalType );
    7255}
    7356
     
    155138                Type * newtype = i->second->clone();
    156139                newtype->get_qualifiers() |= inst->get_qualifiers();
    157                 delete inst;
    158140                return newtype;
    159141        } // if
     
    166148        } else {
    167149                subCount++;
    168                 delete nameExpr;
    169150                return i->second->clone();
    170151        } // if
  • src/SynTree/TypeSubstitution.h

    r6171841 r68f9c43  
    3535        TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin );
    3636        TypeSubstitution( const TypeSubstitution &other );
    37         virtual ~TypeSubstitution();
    3837
    3938        TypeSubstitution &operator=( const TypeSubstitution &other );
     
    101100                        if ( TypeExpr *actual = dynamic_cast< TypeExpr* >( *actualIt ) ) {
    102101                                if ( formal->get_name() != "" ) {
    103                                         TypeEnvType::iterator i = typeEnv.find( formal->get_name() );
    104                                         if ( i != typeEnv.end() ) {
    105                                                 delete i->second;
    106                                         } // if
    107102                                        typeEnv[ formal->get_name() ] = actual->get_type()->clone();
    108103                                } // if
  • src/SynTree/TypeofType.cc

    r6171841 r68f9c43  
    2929}
    3030
    31 TypeofType::~TypeofType() {
    32         delete expr;
    33 }
    34 
    3531void TypeofType::print( std::ostream &os, Indenter indent ) const {
    3632        Type::print( os, indent );
  • src/SynTree/module.mk

    r6171841 r68f9c43  
    4848       SynTree/TypeSubstitution.cc \
    4949       SynTree/Attribute.cc \
     50       SynTree/GcTracer.cc \
    5051       SynTree/VarExprReplacer.cc
    5152
Note: See TracChangeset for help on using the changeset viewer.