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/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 ); }
Note: See TracChangeset for help on using the changeset viewer.