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