Changes in src/SynTree/Expression.h [cdb990a:42107b4]
- File:
-
- 1 edited
-
src/SynTree/Expression.h (modified) (41 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.h
rcdb990a r42107b4 41 41 ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {} 42 42 ParamEntry( const ParamEntry & other ); 43 ParamEntry( ParamEntry && other );44 ~ParamEntry();45 43 ParamEntry & operator=( const ParamEntry & other ); 46 ParamEntry & operator=( ParamEntry && other );47 44 48 45 UniqueId decl; … … 55 52 /// Expression is the root type for all expressions 56 53 class Expression : public BaseSyntaxNode { 54 protected: 55 virtual ~Expression(); 56 57 57 public: 58 58 Type * result; … … 63 63 Expression(); 64 64 Expression( const Expression & other ); 65 virtual ~Expression();66 65 67 66 Type *& get_result() { return result; } … … 76 75 InferredParams & get_inferParams() { return inferParams; } 77 76 78 // move other's inferParams to this79 void spliceInferParams( Expression * other );80 81 77 virtual Expression * clone() const override = 0; 82 78 virtual void accept( Visitor & v ) override = 0; … … 94 90 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); 95 91 ApplicationExpr( const ApplicationExpr & other ); 96 virtual ~ApplicationExpr();97 92 98 93 Expression * get_function() const { return function; } … … 116 111 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); 117 112 UntypedExpr( const UntypedExpr & other ); 118 virtual ~UntypedExpr();119 113 120 114 Expression * get_function() const { return function; } … … 141 135 NameExpr( std::string name ); 142 136 NameExpr( const NameExpr & other ); 143 virtual ~NameExpr();144 137 145 138 const std::string & get_name() const { return name; } … … 162 155 AddressExpr( Expression * arg ); 163 156 AddressExpr( const AddressExpr & other ); 164 virtual ~AddressExpr();165 157 166 158 Expression * get_arg() const { return arg; } … … 181 173 LabelAddressExpr( const Label &arg ); 182 174 LabelAddressExpr( const LabelAddressExpr & other ); 183 virtual ~LabelAddressExpr();184 175 185 176 virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); } … … 199 190 CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor 200 191 CastExpr( const CastExpr & other ); 201 virtual ~CastExpr();202 192 203 193 Expression * get_arg() const { return arg; } … … 220 210 KeywordCastExpr( Expression * arg, Target target ); 221 211 KeywordCastExpr( const KeywordCastExpr & other ); 222 virtual ~KeywordCastExpr();223 212 224 213 const std::string & targetString() const; … … 237 226 VirtualCastExpr( Expression * arg, Type * toType ); 238 227 VirtualCastExpr( const VirtualCastExpr & other ); 239 virtual ~VirtualCastExpr();240 228 241 229 Expression * get_arg() const { return arg; } … … 256 244 UntypedMemberExpr( Expression * member, Expression * aggregate ); 257 245 UntypedMemberExpr( const UntypedMemberExpr & other ); 258 virtual ~UntypedMemberExpr();259 246 260 247 Expression * get_member() const { return member; } … … 278 265 MemberExpr( DeclarationWithType * member, Expression * aggregate ); 279 266 MemberExpr( const MemberExpr & other ); 280 virtual ~MemberExpr();281 267 282 268 DeclarationWithType * get_member() const { return member; } … … 299 285 VariableExpr( DeclarationWithType * var ); 300 286 VariableExpr( const VariableExpr & other ); 301 virtual ~VariableExpr();302 287 303 288 DeclarationWithType * get_var() const { return var; } … … 319 304 ConstantExpr( Constant constant ); 320 305 ConstantExpr( const ConstantExpr & other ); 321 virtual ~ConstantExpr();322 306 323 307 Constant * get_constant() { return & constant; } … … 343 327 SizeofExpr( const SizeofExpr & other ); 344 328 SizeofExpr( Type * type ); 345 virtual ~SizeofExpr();346 329 347 330 Expression * get_expr() const { return expr; } … … 368 351 AlignofExpr( const AlignofExpr & other ); 369 352 AlignofExpr( Type * type ); 370 virtual ~AlignofExpr();371 353 372 354 Expression * get_expr() const { return expr; } … … 391 373 UntypedOffsetofExpr( Type * type, const std::string & member ); 392 374 UntypedOffsetofExpr( const UntypedOffsetofExpr & other ); 393 virtual ~UntypedOffsetofExpr();394 375 395 376 std::string get_member() const { return member; } … … 412 393 OffsetofExpr( Type * type, DeclarationWithType * member ); 413 394 OffsetofExpr( const OffsetofExpr & other ); 414 virtual ~OffsetofExpr();415 395 416 396 Type * get_type() const { return type; } … … 432 412 OffsetPackExpr( StructInstType * type ); 433 413 OffsetPackExpr( const OffsetPackExpr & other ); 434 virtual ~OffsetPackExpr();435 414 436 415 StructInstType * get_type() const { return type; } … … 454 433 AttrExpr( const AttrExpr & other ); 455 434 AttrExpr( Expression * attr, Type * type ); 456 virtual ~AttrExpr();457 435 458 436 Expression * get_attr() const { return attr; } … … 479 457 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true ); 480 458 LogicalExpr( const LogicalExpr & other ); 481 virtual ~LogicalExpr();482 459 483 460 bool get_isAnd() const { return isAnd; } … … 505 482 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ); 506 483 ConditionalExpr( const ConditionalExpr & other ); 507 virtual ~ConditionalExpr();508 484 509 485 Expression * get_arg1() const { return arg1; } … … 528 504 CommaExpr( Expression * arg1, Expression * arg2 ); 529 505 CommaExpr( const CommaExpr & other ); 530 virtual ~CommaExpr();531 506 532 507 Expression * get_arg1() const { return arg1; } … … 548 523 TypeExpr( Type * type ); 549 524 TypeExpr( const TypeExpr & other ); 550 virtual ~TypeExpr();551 525 552 526 Type * get_type() const { return type; } … … 568 542 AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {} 569 543 AsmExpr( const AsmExpr & other ); 570 virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };571 544 572 545 Expression * get_inout() const { return inout; } … … 590 563 /// along with a set of copy constructor calls, one for each argument. 591 564 class ImplicitCopyCtorExpr : public Expression { 565 protected: 566 virtual ~ImplicitCopyCtorExpr(); 567 592 568 public: 593 569 ApplicationExpr * callExpr; … … 598 574 ImplicitCopyCtorExpr( ApplicationExpr * callExpr ); 599 575 ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ); 600 virtual ~ImplicitCopyCtorExpr();601 576 602 577 ApplicationExpr * get_callExpr() const { return callExpr; } … … 620 595 ConstructorExpr( Expression * callExpr ); 621 596 ConstructorExpr( const ConstructorExpr & other ); 622 ~ConstructorExpr();623 597 624 598 Expression * get_callExpr() const { return callExpr; } … … 638 612 CompoundLiteralExpr( Type * type, Initializer * initializer ); 639 613 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 640 virtual ~CompoundLiteralExpr();641 614 642 615 Initializer * get_initializer() const { return initializer; } … … 675 648 UntypedTupleExpr( const std::list< Expression * > & exprs ); 676 649 UntypedTupleExpr( const UntypedTupleExpr & other ); 677 virtual ~UntypedTupleExpr();678 650 679 651 std::list<Expression*>& get_exprs() { return exprs; } … … 692 664 TupleExpr( const std::list< Expression * > & exprs ); 693 665 TupleExpr( const TupleExpr & other ); 694 virtual ~TupleExpr();695 666 696 667 std::list<Expression*>& get_exprs() { return exprs; } … … 710 681 TupleIndexExpr( Expression * tuple, unsigned int index ); 711 682 TupleIndexExpr( const TupleIndexExpr & other ); 712 virtual ~TupleIndexExpr();713 683 714 684 Expression * get_tuple() const { return tuple; } … … 730 700 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ); 731 701 TupleAssignExpr( const TupleAssignExpr & other ); 732 virtual ~TupleAssignExpr();733 702 734 703 TupleAssignExpr * set_stmtExpr( StmtExpr * newValue ) { stmtExpr = newValue; return this; } … … 750 719 StmtExpr( CompoundStmt * statements ); 751 720 StmtExpr( const StmtExpr & other ); 752 virtual ~StmtExpr();753 721 754 722 CompoundStmt * get_statements() const { return statements; } … … 775 743 UniqueExpr( Expression * expr, long long idVal = -1 ); 776 744 UniqueExpr( const UniqueExpr & other ); 777 ~UniqueExpr();778 745 779 746 Expression * get_expr() const { return expr; } … … 805 772 InitAlternative( const InitAlternative & other ); 806 773 InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it 807 ~InitAlternative();808 774 }; 809 775 … … 815 781 UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts ); 816 782 UntypedInitExpr( const UntypedInitExpr & other ); 817 ~UntypedInitExpr();818 783 819 784 Expression * get_expr() const { return expr; } … … 835 800 InitExpr( Expression * expr, Designation * designation ); 836 801 InitExpr( const InitExpr & other ); 837 ~InitExpr();838 802 839 803 Expression * get_expr() const { return expr; } … … 857 821 DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ); 858 822 DeletedExpr( const DeletedExpr & other ); 859 ~DeletedExpr();860 823 861 824 virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); }
Note:
See TracChangeset
for help on using the changeset viewer.