Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rcdb990a r42107b4  
    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( ParamEntry && other );
    44         ~ParamEntry();
    4543        ParamEntry & operator=( const ParamEntry & other );
    46         ParamEntry & operator=( ParamEntry && other );
    4744
    4845        UniqueId decl;
     
    5552/// Expression is the root type for all expressions
    5653class Expression : public BaseSyntaxNode {
     54  protected:
     55        virtual ~Expression();
     56
    5757  public:
    5858        Type * result;
     
    6363        Expression();
    6464        Expression( const Expression & other );
    65         virtual ~Expression();
    6665
    6766        Type *& get_result() { return result; }
     
    7675        InferredParams & get_inferParams() { return inferParams; }
    7776
    78         // move other's inferParams to this
    79         void spliceInferParams( Expression * other );
    80 
    8177        virtual Expression * clone() const override = 0;
    8278        virtual void accept( Visitor & v ) override = 0;
     
    9490        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    9591        ApplicationExpr( const ApplicationExpr & other );
    96         virtual ~ApplicationExpr();
    9792
    9893        Expression * get_function() const { return function; }
     
    116111        UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
    117112        UntypedExpr( const UntypedExpr & other );
    118         virtual ~UntypedExpr();
    119113
    120114        Expression * get_function() const { return function; }
     
    141135        NameExpr( std::string name );
    142136        NameExpr( const NameExpr & other );
    143         virtual ~NameExpr();
    144137
    145138        const std::string & get_name() const { return name; }
     
    162155        AddressExpr( Expression * arg );
    163156        AddressExpr( const AddressExpr & other );
    164         virtual ~AddressExpr();
    165157
    166158        Expression * get_arg() const { return arg; }
     
    181173        LabelAddressExpr( const Label &arg );
    182174        LabelAddressExpr( const LabelAddressExpr & other );
    183         virtual ~LabelAddressExpr();
    184175
    185176        virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); }
     
    199190        CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor
    200191        CastExpr( const CastExpr & other );
    201         virtual ~CastExpr();
    202192
    203193        Expression * get_arg() const { return arg; }
     
    220210        KeywordCastExpr( Expression * arg, Target target );
    221211        KeywordCastExpr( const KeywordCastExpr & other );
    222         virtual ~KeywordCastExpr();
    223212
    224213        const std::string & targetString() const;
     
    237226        VirtualCastExpr( Expression * arg, Type * toType );
    238227        VirtualCastExpr( const VirtualCastExpr & other );
    239         virtual ~VirtualCastExpr();
    240228
    241229        Expression * get_arg() const { return arg; }
     
    256244        UntypedMemberExpr( Expression * member, Expression * aggregate );
    257245        UntypedMemberExpr( const UntypedMemberExpr & other );
    258         virtual ~UntypedMemberExpr();
    259246
    260247        Expression * get_member() const { return member; }
     
    278265        MemberExpr( DeclarationWithType * member, Expression * aggregate );
    279266        MemberExpr( const MemberExpr & other );
    280         virtual ~MemberExpr();
    281267
    282268        DeclarationWithType * get_member() const { return member; }
     
    299285        VariableExpr( DeclarationWithType * var );
    300286        VariableExpr( const VariableExpr & other );
    301         virtual ~VariableExpr();
    302287
    303288        DeclarationWithType * get_var() const { return var; }
     
    319304        ConstantExpr( Constant constant );
    320305        ConstantExpr( const ConstantExpr & other );
    321         virtual ~ConstantExpr();
    322306
    323307        Constant * get_constant() { return & constant; }
     
    343327        SizeofExpr( const SizeofExpr & other );
    344328        SizeofExpr( Type * type );
    345         virtual ~SizeofExpr();
    346329
    347330        Expression * get_expr() const { return expr; }
     
    368351        AlignofExpr( const AlignofExpr & other );
    369352        AlignofExpr( Type * type );
    370         virtual ~AlignofExpr();
    371353
    372354        Expression * get_expr() const { return expr; }
     
    391373        UntypedOffsetofExpr( Type * type, const std::string & member );
    392374        UntypedOffsetofExpr( const UntypedOffsetofExpr & other );
    393         virtual ~UntypedOffsetofExpr();
    394375
    395376        std::string get_member() const { return member; }
     
    412393        OffsetofExpr( Type * type, DeclarationWithType * member );
    413394        OffsetofExpr( const OffsetofExpr & other );
    414         virtual ~OffsetofExpr();
    415395
    416396        Type * get_type() const { return type; }
     
    432412        OffsetPackExpr( StructInstType * type );
    433413        OffsetPackExpr( const OffsetPackExpr & other );
    434         virtual ~OffsetPackExpr();
    435414
    436415        StructInstType * get_type() const { return type; }
     
    454433        AttrExpr( const AttrExpr & other );
    455434        AttrExpr( Expression * attr, Type * type );
    456         virtual ~AttrExpr();
    457435
    458436        Expression * get_attr() const { return attr; }
     
    479457        LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true );
    480458        LogicalExpr( const LogicalExpr & other );
    481         virtual ~LogicalExpr();
    482459
    483460        bool get_isAnd() const { return isAnd; }
     
    505482        ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 );
    506483        ConditionalExpr( const ConditionalExpr & other );
    507         virtual ~ConditionalExpr();
    508484
    509485        Expression * get_arg1() const { return arg1; }
     
    528504        CommaExpr( Expression * arg1, Expression * arg2 );
    529505        CommaExpr( const CommaExpr & other );
    530         virtual ~CommaExpr();
    531506
    532507        Expression * get_arg1() const { return arg1; }
     
    548523        TypeExpr( Type * type );
    549524        TypeExpr( const TypeExpr & other );
    550         virtual ~TypeExpr();
    551525
    552526        Type * get_type() const { return type; }
     
    568542        AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
    569543        AsmExpr( const AsmExpr & other );
    570         virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
    571544
    572545        Expression * get_inout() const { return inout; }
     
    590563/// along with a set of copy constructor calls, one for each argument.
    591564class ImplicitCopyCtorExpr : public Expression {
     565protected:
     566        virtual ~ImplicitCopyCtorExpr();
     567
    592568public:
    593569        ApplicationExpr * callExpr;
     
    598574        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
    599575        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
    600         virtual ~ImplicitCopyCtorExpr();
    601576
    602577        ApplicationExpr * get_callExpr() const { return callExpr; }
     
    620595        ConstructorExpr( Expression * callExpr );
    621596        ConstructorExpr( const ConstructorExpr & other );
    622         ~ConstructorExpr();
    623597
    624598        Expression * get_callExpr() const { return callExpr; }
     
    638612        CompoundLiteralExpr( Type * type, Initializer * initializer );
    639613        CompoundLiteralExpr( const CompoundLiteralExpr & other );
    640         virtual ~CompoundLiteralExpr();
    641614
    642615        Initializer * get_initializer() const { return initializer; }
     
    675648        UntypedTupleExpr( const std::list< Expression * > & exprs );
    676649        UntypedTupleExpr( const UntypedTupleExpr & other );
    677         virtual ~UntypedTupleExpr();
    678650
    679651        std::list<Expression*>& get_exprs() { return exprs; }
     
    692664        TupleExpr( const std::list< Expression * > & exprs );
    693665        TupleExpr( const TupleExpr & other );
    694         virtual ~TupleExpr();
    695666
    696667        std::list<Expression*>& get_exprs() { return exprs; }
     
    710681        TupleIndexExpr( Expression * tuple, unsigned int index );
    711682        TupleIndexExpr( const TupleIndexExpr & other );
    712         virtual ~TupleIndexExpr();
    713683
    714684        Expression * get_tuple() const { return tuple; }
     
    730700        TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls );
    731701        TupleAssignExpr( const TupleAssignExpr & other );
    732         virtual ~TupleAssignExpr();
    733702
    734703        TupleAssignExpr * set_stmtExpr( StmtExpr * newValue ) { stmtExpr = newValue; return this; }
     
    750719        StmtExpr( CompoundStmt * statements );
    751720        StmtExpr( const StmtExpr & other );
    752         virtual ~StmtExpr();
    753721
    754722        CompoundStmt * get_statements() const { return statements; }
     
    775743        UniqueExpr( Expression * expr, long long idVal = -1 );
    776744        UniqueExpr( const UniqueExpr & other );
    777         ~UniqueExpr();
    778745
    779746        Expression * get_expr() const { return expr; }
     
    805772        InitAlternative( const InitAlternative & other );
    806773        InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it
    807         ~InitAlternative();
    808774};
    809775
     
    815781        UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts );
    816782        UntypedInitExpr( const UntypedInitExpr & other );
    817         ~UntypedInitExpr();
    818783
    819784        Expression * get_expr() const { return expr; }
     
    835800        InitExpr( Expression * expr, Designation * designation );
    836801        InitExpr( const InitExpr & other );
    837         ~InitExpr();
    838802
    839803        Expression * get_expr() const { return expr; }
     
    857821        DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt );
    858822        DeletedExpr( const DeletedExpr & other );
    859         ~DeletedExpr();
    860823
    861824        virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); }
Note: See TracChangeset for help on using the changeset viewer.