Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r42107b4 r9a705dc8  
    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();
    4344        ParamEntry & operator=( const ParamEntry & other );
    4445
     
    5253/// Expression is the root type for all expressions
    5354class Expression : public BaseSyntaxNode {
    54   protected:
    55         virtual ~Expression();
    56 
    5755  public:
    5856        Type * result;
     
    6361        Expression();
    6462        Expression( const Expression & other );
     63        virtual ~Expression();
    6564
    6665        Type *& get_result() { return result; }
     
    9089        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    9190        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();
    113114
    114115        Expression * get_function() const { return function; }
     
    135136        NameExpr( std::string name );
    136137        NameExpr( const NameExpr & other );
     138        virtual ~NameExpr();
    137139
    138140        const std::string & get_name() const { return name; }
     
    155157        AddressExpr( Expression * arg );
    156158        AddressExpr( const AddressExpr & other );
     159        virtual ~AddressExpr();
    157160
    158161        Expression * get_arg() const { return arg; }
     
    173176        LabelAddressExpr( const Label &arg );
    174177        LabelAddressExpr( const LabelAddressExpr & other );
     178        virtual ~LabelAddressExpr();
    175179
    176180        virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); }
     
    190194        CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor
    191195        CastExpr( const CastExpr & other );
     196        virtual ~CastExpr();
    192197
    193198        Expression * get_arg() const { return arg; }
     
    210215        KeywordCastExpr( Expression * arg, Target target );
    211216        KeywordCastExpr( const KeywordCastExpr & other );
     217        virtual ~KeywordCastExpr();
    212218
    213219        const std::string & targetString() const;
     
    226232        VirtualCastExpr( Expression * arg, Type * toType );
    227233        VirtualCastExpr( const VirtualCastExpr & other );
     234        virtual ~VirtualCastExpr();
    228235
    229236        Expression * get_arg() const { return arg; }
     
    244251        UntypedMemberExpr( Expression * member, Expression * aggregate );
    245252        UntypedMemberExpr( const UntypedMemberExpr & other );
     253        virtual ~UntypedMemberExpr();
    246254
    247255        Expression * get_member() const { return member; }
     
    265273        MemberExpr( DeclarationWithType * member, Expression * aggregate );
    266274        MemberExpr( const MemberExpr & other );
     275        virtual ~MemberExpr();
    267276
    268277        DeclarationWithType * get_member() const { return member; }
     
    285294        VariableExpr( DeclarationWithType * var );
    286295        VariableExpr( const VariableExpr & other );
     296        virtual ~VariableExpr();
    287297
    288298        DeclarationWithType * get_var() const { return var; }
     
    304314        ConstantExpr( Constant constant );
    305315        ConstantExpr( const ConstantExpr & other );
     316        virtual ~ConstantExpr();
    306317
    307318        Constant * get_constant() { return & constant; }
     
    327338        SizeofExpr( const SizeofExpr & other );
    328339        SizeofExpr( Type * type );
     340        virtual ~SizeofExpr();
    329341
    330342        Expression * get_expr() const { return expr; }
     
    351363        AlignofExpr( const AlignofExpr & other );
    352364        AlignofExpr( Type * type );
     365        virtual ~AlignofExpr();
    353366
    354367        Expression * get_expr() const { return expr; }
     
    373386        UntypedOffsetofExpr( Type * type, const std::string & member );
    374387        UntypedOffsetofExpr( const UntypedOffsetofExpr & other );
     388        virtual ~UntypedOffsetofExpr();
    375389
    376390        std::string get_member() const { return member; }
     
    393407        OffsetofExpr( Type * type, DeclarationWithType * member );
    394408        OffsetofExpr( const OffsetofExpr & other );
     409        virtual ~OffsetofExpr();
    395410
    396411        Type * get_type() const { return type; }
     
    412427        OffsetPackExpr( StructInstType * type );
    413428        OffsetPackExpr( const OffsetPackExpr & other );
     429        virtual ~OffsetPackExpr();
    414430
    415431        StructInstType * get_type() const { return type; }
     
    433449        AttrExpr( const AttrExpr & other );
    434450        AttrExpr( Expression * attr, Type * type );
     451        virtual ~AttrExpr();
    435452
    436453        Expression * get_attr() const { return attr; }
     
    457474        LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true );
    458475        LogicalExpr( const LogicalExpr & other );
     476        virtual ~LogicalExpr();
    459477
    460478        bool get_isAnd() const { return isAnd; }
     
    482500        ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 );
    483501        ConditionalExpr( const ConditionalExpr & other );
     502        virtual ~ConditionalExpr();
    484503
    485504        Expression * get_arg1() const { return arg1; }
     
    504523        CommaExpr( Expression * arg1, Expression * arg2 );
    505524        CommaExpr( const CommaExpr & other );
     525        virtual ~CommaExpr();
    506526
    507527        Expression * get_arg1() const { return arg1; }
     
    523543        TypeExpr( Type * type );
    524544        TypeExpr( const TypeExpr & other );
     545        virtual ~TypeExpr();
    525546
    526547        Type * get_type() const { return type; }
     
    542563        AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
    543564        AsmExpr( const AsmExpr & other );
     565        virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
    544566
    545567        Expression * get_inout() const { return inout; }
     
    563585/// along with a set of copy constructor calls, one for each argument.
    564586class ImplicitCopyCtorExpr : public Expression {
    565 protected:
    566         virtual ~ImplicitCopyCtorExpr();
    567 
    568587public:
    569588        ApplicationExpr * callExpr;
     
    574593        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
    575594        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
     595        virtual ~ImplicitCopyCtorExpr();
    576596
    577597        ApplicationExpr * get_callExpr() const { return callExpr; }
     
    595615        ConstructorExpr( Expression * callExpr );
    596616        ConstructorExpr( const ConstructorExpr & other );
     617        ~ConstructorExpr();
    597618
    598619        Expression * get_callExpr() const { return callExpr; }
     
    612633        CompoundLiteralExpr( Type * type, Initializer * initializer );
    613634        CompoundLiteralExpr( const CompoundLiteralExpr & other );
     635        virtual ~CompoundLiteralExpr();
    614636
    615637        Initializer * get_initializer() const { return initializer; }
     
    648670        UntypedTupleExpr( const std::list< Expression * > & exprs );
    649671        UntypedTupleExpr( const UntypedTupleExpr & other );
     672        virtual ~UntypedTupleExpr();
    650673
    651674        std::list<Expression*>& get_exprs() { return exprs; }
     
    664687        TupleExpr( const std::list< Expression * > & exprs );
    665688        TupleExpr( const TupleExpr & other );
     689        virtual ~TupleExpr();
    666690
    667691        std::list<Expression*>& get_exprs() { return exprs; }
     
    681705        TupleIndexExpr( Expression * tuple, unsigned int index );
    682706        TupleIndexExpr( const TupleIndexExpr & other );
     707        virtual ~TupleIndexExpr();
    683708
    684709        Expression * get_tuple() const { return tuple; }
     
    700725        TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls );
    701726        TupleAssignExpr( const TupleAssignExpr & other );
     727        virtual ~TupleAssignExpr();
    702728
    703729        TupleAssignExpr * set_stmtExpr( StmtExpr * newValue ) { stmtExpr = newValue; return this; }
     
    719745        StmtExpr( CompoundStmt * statements );
    720746        StmtExpr( const StmtExpr & other );
     747        virtual ~StmtExpr();
    721748
    722749        CompoundStmt * get_statements() const { return statements; }
     
    743770        UniqueExpr( Expression * expr, long long idVal = -1 );
    744771        UniqueExpr( const UniqueExpr & other );
     772        ~UniqueExpr();
    745773
    746774        Expression * get_expr() const { return expr; }
     
    772800        InitAlternative( const InitAlternative & other );
    773801        InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it
     802        ~InitAlternative();
    774803};
    775804
     
    781810        UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts );
    782811        UntypedInitExpr( const UntypedInitExpr & other );
     812        ~UntypedInitExpr();
    783813
    784814        Expression * get_expr() const { return expr; }
     
    800830        InitExpr( Expression * expr, Designation * designation );
    801831        InitExpr( const InitExpr & other );
     832        ~InitExpr();
    802833
    803834        Expression * get_expr() const { return expr; }
     
    821852        DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt );
    822853        DeletedExpr( const DeletedExpr & other );
     854        ~DeletedExpr();
    823855
    824856        virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); }
Note: See TracChangeset for help on using the changeset viewer.