Changeset 68f9c43 for src/SynTree
- Timestamp:
- Mar 16, 2018, 5:15:02 PM (8 years ago)
- 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)
- Location:
- src/SynTree
- Files:
-
- 2 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AddressExpr.cc
r6171841 r68f9c43 58 58 } 59 59 60 AddressExpr::~AddressExpr() {61 delete arg;62 }63 64 60 void AddressExpr::print( std::ostream &os, Indenter indent ) const { 65 61 os << "Address of:" << std::endl; … … 75 71 } 76 72 LabelAddressExpr::LabelAddressExpr( const LabelAddressExpr & other ) : Expression( other ), arg( other.arg ) {} 77 LabelAddressExpr::~LabelAddressExpr() {}78 73 79 74 void LabelAddressExpr::print( std::ostream & os, Indenter ) const { -
src/SynTree/AggregateDecl.cc
r6171841 r68f9c43 33 33 cloneAll( other.attributes, attributes ); 34 34 body = other.body; 35 }36 37 AggregateDecl::~AggregateDecl() {38 deleteAll( attributes );39 deleteAll( parameters );40 deleteAll( members );41 35 } 42 36 -
src/SynTree/ApplicationExpr.cc
r6171841 r68f9c43 43 43 } 44 44 45 ParamEntry::~ParamEntry() {46 delete actualType;47 delete formalType;48 delete expr;49 }50 51 45 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) { 52 46 PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() ); … … 61 55 Expression( other ), function( maybeClone( other.function ) ) { 62 56 cloneAll( other.args, args ); 63 }64 65 ApplicationExpr::~ApplicationExpr() {66 delete function;67 deleteAll( args );68 57 } 69 58 -
src/SynTree/ArrayType.cc
r6171841 r68f9c43 34 34 } 35 35 36 ArrayType::~ArrayType() {37 delete base;38 delete dimension;39 }40 41 36 void ArrayType::print( std::ostream &os, Indenter indent ) const { 42 37 Type::print( os, indent ); -
src/SynTree/AttrType.cc
r6171841 r68f9c43 37 37 } 38 38 39 AttrType::~AttrType() {40 delete expr;41 delete type;42 }43 44 39 void AttrType::print( std::ostream &os, Indenter indent ) const { 45 40 Type::print( os, indent ); -
src/SynTree/Attribute.cc
r6171841 r68f9c43 23 23 Attribute::Attribute( const Attribute &other ) : name( other.name ) { 24 24 cloneAll( other.parameters, parameters ); 25 }26 27 Attribute::~Attribute() {28 deleteAll( parameters );29 25 } 30 26 -
src/SynTree/Attribute.h
r6171841 r68f9c43 36 36 Attribute( std::string name = "", const std::list< Expression * > & parameters = std::list< Expression * >() ) : name( name ), parameters( parameters ) {} 37 37 Attribute( const Attribute &other ); 38 virtual ~Attribute();39 38 40 39 std::string get_name() const { return name; } -
src/SynTree/BaseSyntaxNode.h
r6171841 r68f9c43 17 17 18 18 #include "Common/CodeLocation.h" 19 #include "Common/GC.h" 19 20 #include "Common/Indenter.h" 21 20 22 class Visitor; 21 23 class Mutator; 22 24 23 class BaseSyntaxNode {24 25 class BaseSyntaxNode : GC_Object { 26 public: 25 27 CodeLocation location; 26 27 virtual ~BaseSyntaxNode() {}28 28 29 29 virtual BaseSyntaxNode * clone() const = 0; -
src/SynTree/CommaExpr.cc
r6171841 r68f9c43 34 34 } 35 35 36 CommaExpr::~CommaExpr() {37 delete arg1;38 delete arg2;39 }40 41 36 void CommaExpr::print( std::ostream &os, Indenter indent ) const { 42 37 os << "Comma Expression:" << std::endl; -
src/SynTree/CompoundStmt.cc
r6171841 r68f9c43 68 68 } 69 69 70 CompoundStmt::~CompoundStmt() {71 deleteAll( kids );72 }73 74 70 void CompoundStmt::print( std::ostream &os, Indenter indent ) const { 75 71 os << "CompoundStmt" << endl; -
src/SynTree/Constant.cc
r6171841 r68f9c43 27 27 type = other.type->clone(); 28 28 } 29 30 Constant::~Constant() { delete type; }31 29 32 30 Constant Constant::from_bool( bool b ) { -
src/SynTree/Constant.h
r6171841 r68f9c43 30 30 Constant( Type * type, std::string rep, double val ); 31 31 Constant( const Constant & other ); 32 virtual ~Constant(); 33 32 34 33 virtual Constant * clone() const { return new Constant( *this ); } 35 34 -
src/SynTree/DeclStmt.cc
r6171841 r68f9c43 29 29 } 30 30 31 DeclStmt::~DeclStmt() {32 delete decl;33 }34 35 31 void DeclStmt::print( std::ostream &os, Indenter indent ) const { 36 32 assert( decl != 0 ); -
src/SynTree/Declaration.cc
r6171841 r68f9c43 38 38 } 39 39 40 Declaration::~Declaration() {41 }42 43 40 void Declaration::fixUniqueId() { 44 41 // don't need to set unique ID twice … … 68 65 } 69 66 70 AsmDecl::~AsmDecl() {71 delete stmt;72 }73 74 67 void AsmDecl::print( std::ostream &os, Indenter indent ) const { 75 68 stmt->print( os, indent ); -
src/SynTree/Declaration.h
r6171841 r68f9c43 45 45 Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage ); 46 46 Declaration( const Declaration &other ); 47 virtual ~Declaration();48 47 49 48 const std::string &get_name() const { return name; } … … 87 86 DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs ); 88 87 DeclarationWithType( const DeclarationWithType &other ); 89 virtual ~DeclarationWithType(); 90 88 91 89 std::string get_mangleName() const { return mangleName; } 92 90 DeclarationWithType * set_mangleName( std::string newValue ) { mangleName = newValue; return this; } … … 126 124 const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() ); 127 125 ObjectDecl( const ObjectDecl &other ); 128 virtual ~ObjectDecl();129 126 130 127 virtual Type * get_type() const override { return type; } … … 156 153 const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() ); 157 154 FunctionDecl( const FunctionDecl &other ); 158 virtual ~FunctionDecl();159 155 160 156 virtual Type * get_type() const override { return type; } … … 184 180 NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type ); 185 181 NamedTypeDecl( const NamedTypeDecl &other ); 186 virtual ~NamedTypeDecl();187 182 188 183 Type *get_base() const { return base; } … … 219 214 TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr ); 220 215 TypeDecl( const TypeDecl &other ); 221 virtual ~TypeDecl();222 216 223 217 Kind get_kind() const { return kind; } … … 268 262 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); 269 263 AggregateDecl( const AggregateDecl &other ); 270 virtual ~AggregateDecl(); 271 264 272 265 std::list<Declaration*>& get_members() { return members; } 273 266 std::list<TypeDecl*>& get_parameters() { return parameters; } … … 353 346 AsmDecl( AsmStmt *stmt ); 354 347 AsmDecl( const AsmDecl &other ); 355 virtual ~AsmDecl();356 348 357 349 AsmStmt *get_stmt() { return stmt; } -
src/SynTree/DeclarationWithType.cc
r6171841 r68f9c43 34 34 } 35 35 36 DeclarationWithType::~DeclarationWithType() {37 deleteAll( attributes );38 delete asmName;39 }40 41 36 // Local Variables: // 42 37 // tab-width: 4 // -
src/SynTree/Expression.cc
r6171841 r68f9c43 52 52 Expression::~Expression() { 53 53 delete env; 54 delete result;55 54 } 56 55 … … 74 73 ConstantExpr::ConstantExpr( const ConstantExpr &other) : Expression( other ), constant( other.constant ) { 75 74 } 76 77 ConstantExpr::~ConstantExpr() {}78 75 79 76 void ConstantExpr::print( std::ostream &os, Indenter indent ) const { … … 120 117 } 121 118 122 VariableExpr::~VariableExpr() {123 // don't delete the declaration, since it points somewhere else in the tree124 }125 126 119 VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) { 127 120 VariableExpr * funcExpr = new VariableExpr( func ); … … 150 143 } 151 144 152 SizeofExpr::~SizeofExpr() {153 delete expr;154 delete type;155 }156 157 145 void SizeofExpr::print( std::ostream &os, Indenter indent) const { 158 146 os << "Sizeof Expression on: "; … … 176 164 } 177 165 178 AlignofExpr::~AlignofExpr() {179 delete expr;180 delete type;181 }182 183 166 void AlignofExpr::print( std::ostream &os, Indenter indent) const { 184 167 os << "Alignof Expression on: "; … … 196 179 UntypedOffsetofExpr::UntypedOffsetofExpr( const UntypedOffsetofExpr &other ) : 197 180 Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {} 198 199 UntypedOffsetofExpr::~UntypedOffsetofExpr() {200 delete type;201 }202 181 203 182 void UntypedOffsetofExpr::print( std::ostream &os, Indenter indent) const { … … 217 196 Expression( other ), type( maybeClone( other.type ) ), member( other.member ) {} 218 197 219 OffsetofExpr::~OffsetofExpr() {220 delete type;221 }222 223 198 void OffsetofExpr::print( std::ostream &os, Indenter indent) const { 224 199 os << "Offsetof Expression on member " << member->name << " of "; … … 234 209 OffsetPackExpr::OffsetPackExpr( const OffsetPackExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) {} 235 210 236 OffsetPackExpr::~OffsetPackExpr() { delete type; }237 238 211 void OffsetPackExpr::print( std::ostream &os, Indenter indent ) const { 239 212 os << "Offset pack expression on "; … … 252 225 AttrExpr::AttrExpr( const AttrExpr &other ) : 253 226 Expression( other ), attr( maybeClone( other.attr ) ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) { 254 }255 256 AttrExpr::~AttrExpr() {257 delete attr;258 delete expr;259 delete type;260 227 } 261 228 … … 280 247 281 248 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) { 282 }283 284 CastExpr::~CastExpr() {285 delete arg;286 249 } 287 250 … … 306 269 } 307 270 308 VirtualCastExpr::~VirtualCastExpr() {309 delete arg;310 }311 312 271 void VirtualCastExpr::print( std::ostream &os, Indenter indent ) const { 313 272 os << "Virtual Cast of:" << std::endl << indent+1; … … 332 291 } 333 292 334 UntypedMemberExpr::~UntypedMemberExpr() {335 delete aggregate;336 delete member;337 }338 339 293 void UntypedMemberExpr::print( std::ostream &os, Indenter indent ) const { 340 294 os << "Untyped Member Expression, with field: " << std::endl << indent+1; … … 363 317 } 364 318 365 MemberExpr::~MemberExpr() {366 // don't delete the member declaration, since it points somewhere else in the tree367 delete aggregate;368 }369 370 319 void MemberExpr::print( std::ostream &os, Indenter indent ) const { 371 320 os << "Member Expression, with field: " << std::endl; … … 383 332 Expression( other ), function( maybeClone( other.function ) ) { 384 333 cloneAll( other.args, args ); 385 }386 387 UntypedExpr::~UntypedExpr() {388 delete function;389 deleteAll( args );390 334 } 391 335 … … 436 380 } 437 381 438 NameExpr::~NameExpr() {}439 440 382 void NameExpr::print( std::ostream &os, Indenter indent ) const { 441 383 os << "Name: " << get_name(); … … 450 392 LogicalExpr::LogicalExpr( const LogicalExpr &other ) : 451 393 Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), isAnd( other.isAnd ) { 452 }453 454 LogicalExpr::~LogicalExpr() {455 delete arg1;456 delete arg2;457 394 } 458 395 … … 470 407 ConditionalExpr::ConditionalExpr( const ConditionalExpr &other ) : 471 408 Expression( other ), arg1( maybeClone( other.arg1 ) ), arg2( maybeClone( other.arg2 ) ), arg3( maybeClone( other.arg3 ) ) { 472 }473 474 ConditionalExpr::~ConditionalExpr() {475 delete arg1;476 delete arg2;477 delete arg3;478 409 } 479 410 … … 513 444 ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() { 514 445 set_env( nullptr ); // ImplicitCopyCtorExpr does not take ownership of an environment 515 delete callExpr;516 deleteAll( tempDecls );517 deleteAll( returnDecls );518 deleteAll( dtors );519 446 } 520 447 … … 541 468 } 542 469 543 ConstructorExpr::~ConstructorExpr() {544 delete callExpr;545 }546 547 470 void ConstructorExpr::print( std::ostream &os, Indenter indent ) const { 548 471 os << "Constructor Expression: " << std::endl << indent+1; … … 559 482 560 483 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), initializer( other.initializer->clone() ) {} 561 562 CompoundLiteralExpr::~CompoundLiteralExpr() {563 delete initializer;564 }565 484 566 485 void CompoundLiteralExpr::print( std::ostream &os, Indenter indent ) const { … … 589 508 cloneAll( other.dtors, dtors ); 590 509 } 591 StmtExpr::~StmtExpr() {592 delete statements;593 deleteAll( dtors );594 deleteAll( returnDecls );595 }596 510 void StmtExpr::computeResult() { 597 511 assert( statements ); 598 512 std::list< Statement * > & body = statements->kids; 599 delete result;600 513 result = nullptr; 601 514 if ( ! returnDecls.empty() ) { … … 640 553 UniqueExpr::UniqueExpr( const UniqueExpr &other ) : Expression( other ), expr( maybeClone( other.expr ) ), object( maybeClone( other.object ) ), var( maybeClone( other.var ) ), id( other.id ) { 641 554 } 642 UniqueExpr::~UniqueExpr() { 643 delete expr; 644 delete object; 645 delete var; 646 } 555 647 556 void UniqueExpr::print( std::ostream &os, Indenter indent ) const { 648 557 os << "Unique Expression with id:" << id << std::endl << indent+1; … … 657 566 InitAlternative::InitAlternative( Type * type, Designation * designation ) : type( type ), designation( designation ) {} 658 567 InitAlternative::InitAlternative( const InitAlternative & other ) : type( maybeClone( other.type ) ), designation( maybeClone( other.designation ) ) {} 659 InitAlternative::~InitAlternative() {660 delete type;661 delete designation;662 }663 568 664 569 UntypedInitExpr::UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts ) : expr( expr ), initAlts( initAlts ) {} 665 570 UntypedInitExpr::UntypedInitExpr( const UntypedInitExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), initAlts( other.initAlts ) {} 666 UntypedInitExpr::~UntypedInitExpr() {667 delete expr;668 }669 571 670 572 void UntypedInitExpr::print( std::ostream & os, Indenter indent ) const { … … 684 586 } 685 587 InitExpr::InitExpr( const InitExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), designation( maybeClone( other.designation) ) {} 686 InitExpr::~InitExpr() {687 delete expr;688 delete designation;689 }690 588 691 589 void InitExpr::print( std::ostream & os, Indenter indent ) const { … … 701 599 } 702 600 DeletedExpr::DeletedExpr( const DeletedExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), deleteStmt( other.deleteStmt ) {} 703 DeletedExpr::~DeletedExpr() {704 delete expr;705 }706 601 707 602 void DeletedExpr::print( std::ostream & os, Indenter indent ) const { -
src/SynTree/Expression.h
r6171841 r68f9c43 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();44 43 ParamEntry & operator=( const ParamEntry & other ); 45 44 … … 53 52 /// Expression is the root type for all expressions 54 53 class Expression : public BaseSyntaxNode { 54 protected: 55 virtual ~Expression(); 56 55 57 public: 56 58 Type * result; … … 61 63 Expression(); 62 64 Expression( const Expression & other ); 63 virtual ~Expression();64 65 65 66 Type *& get_result() { return result; } … … 89 90 ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); 90 91 ApplicationExpr( const ApplicationExpr & other ); 91 virtual ~ApplicationExpr();92 92 93 93 Expression * get_function() const { return function; } … … 111 111 UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() ); 112 112 UntypedExpr( const UntypedExpr & other ); 113 virtual ~UntypedExpr();114 113 115 114 Expression * get_function() const { return function; } … … 136 135 NameExpr( std::string name ); 137 136 NameExpr( const NameExpr & other ); 138 virtual ~NameExpr();139 137 140 138 const std::string & get_name() const { return name; } … … 157 155 AddressExpr( Expression * arg ); 158 156 AddressExpr( const AddressExpr & other ); 159 virtual ~AddressExpr();160 157 161 158 Expression * get_arg() const { return arg; } … … 176 173 LabelAddressExpr( const Label &arg ); 177 174 LabelAddressExpr( const LabelAddressExpr & other ); 178 virtual ~LabelAddressExpr();179 175 180 176 virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); } … … 192 188 CastExpr( Expression * arg, Type * toType ); 193 189 CastExpr( const CastExpr & other ); 194 virtual ~CastExpr();195 190 196 191 Expression * get_arg() const { return arg; } … … 210 205 VirtualCastExpr( Expression * arg, Type * toType ); 211 206 VirtualCastExpr( const VirtualCastExpr & other ); 212 virtual ~VirtualCastExpr();213 207 214 208 Expression * get_arg() const { return arg; } … … 229 223 UntypedMemberExpr( Expression * member, Expression * aggregate ); 230 224 UntypedMemberExpr( const UntypedMemberExpr & other ); 231 virtual ~UntypedMemberExpr();232 225 233 226 Expression * get_member() const { return member; } … … 251 244 MemberExpr( DeclarationWithType * member, Expression * aggregate ); 252 245 MemberExpr( const MemberExpr & other ); 253 virtual ~MemberExpr();254 246 255 247 DeclarationWithType * get_member() const { return member; } … … 272 264 VariableExpr( DeclarationWithType * var ); 273 265 VariableExpr( const VariableExpr & other ); 274 virtual ~VariableExpr();275 266 276 267 DeclarationWithType * get_var() const { return var; } … … 292 283 ConstantExpr( Constant constant ); 293 284 ConstantExpr( const ConstantExpr & other ); 294 virtual ~ConstantExpr();295 285 296 286 Constant * get_constant() { return & constant; } … … 316 306 SizeofExpr( const SizeofExpr & other ); 317 307 SizeofExpr( Type * type ); 318 virtual ~SizeofExpr();319 308 320 309 Expression * get_expr() const { return expr; } … … 341 330 AlignofExpr( const AlignofExpr & other ); 342 331 AlignofExpr( Type * type ); 343 virtual ~AlignofExpr();344 332 345 333 Expression * get_expr() const { return expr; } … … 364 352 UntypedOffsetofExpr( Type * type, const std::string & member ); 365 353 UntypedOffsetofExpr( const UntypedOffsetofExpr & other ); 366 virtual ~UntypedOffsetofExpr();367 354 368 355 std::string get_member() const { return member; } … … 385 372 OffsetofExpr( Type * type, DeclarationWithType * member ); 386 373 OffsetofExpr( const OffsetofExpr & other ); 387 virtual ~OffsetofExpr();388 374 389 375 Type * get_type() const { return type; } … … 405 391 OffsetPackExpr( StructInstType * type ); 406 392 OffsetPackExpr( const OffsetPackExpr & other ); 407 virtual ~OffsetPackExpr();408 393 409 394 StructInstType * get_type() const { return type; } … … 427 412 AttrExpr( const AttrExpr & other ); 428 413 AttrExpr( Expression * attr, Type * type ); 429 virtual ~AttrExpr();430 414 431 415 Expression * get_attr() const { return attr; } … … 452 436 LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true ); 453 437 LogicalExpr( const LogicalExpr & other ); 454 virtual ~LogicalExpr();455 438 456 439 bool get_isAnd() const { return isAnd; } … … 478 461 ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3 ); 479 462 ConditionalExpr( const ConditionalExpr & other ); 480 virtual ~ConditionalExpr();481 463 482 464 Expression * get_arg1() const { return arg1; } … … 501 483 CommaExpr( Expression * arg1, Expression * arg2 ); 502 484 CommaExpr( const CommaExpr & other ); 503 virtual ~CommaExpr();504 485 505 486 Expression * get_arg1() const { return arg1; } … … 521 502 TypeExpr( Type * type ); 522 503 TypeExpr( const TypeExpr & other ); 523 virtual ~TypeExpr();524 504 525 505 Type * get_type() const { return type; } … … 541 521 AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {} 542 522 AsmExpr( const AsmExpr & other ); 543 virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };544 523 545 524 Expression * get_inout() const { return inout; } … … 563 542 /// along with a set of copy constructor calls, one for each argument. 564 543 class ImplicitCopyCtorExpr : public Expression { 544 protected: 545 virtual ~ImplicitCopyCtorExpr(); 546 565 547 public: 566 548 ApplicationExpr * callExpr; … … 571 553 ImplicitCopyCtorExpr( ApplicationExpr * callExpr ); 572 554 ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ); 573 virtual ~ImplicitCopyCtorExpr();574 555 575 556 ApplicationExpr * get_callExpr() const { return callExpr; } … … 593 574 ConstructorExpr( Expression * callExpr ); 594 575 ConstructorExpr( const ConstructorExpr & other ); 595 ~ConstructorExpr();596 576 597 577 Expression * get_callExpr() const { return callExpr; } … … 611 591 CompoundLiteralExpr( Type * type, Initializer * initializer ); 612 592 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 613 virtual ~CompoundLiteralExpr();614 593 615 594 Initializer * get_initializer() const { return initializer; } … … 648 627 UntypedTupleExpr( const std::list< Expression * > & exprs ); 649 628 UntypedTupleExpr( const UntypedTupleExpr & other ); 650 virtual ~UntypedTupleExpr();651 629 652 630 std::list<Expression*>& get_exprs() { return exprs; } … … 665 643 TupleExpr( const std::list< Expression * > & exprs ); 666 644 TupleExpr( const TupleExpr & other ); 667 virtual ~TupleExpr();668 645 669 646 std::list<Expression*>& get_exprs() { return exprs; } … … 683 660 TupleIndexExpr( Expression * tuple, unsigned int index ); 684 661 TupleIndexExpr( const TupleIndexExpr & other ); 685 virtual ~TupleIndexExpr();686 662 687 663 Expression * get_tuple() const { return tuple; } … … 703 679 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls ); 704 680 TupleAssignExpr( const TupleAssignExpr & other ); 705 virtual ~TupleAssignExpr();706 681 707 682 TupleAssignExpr * set_stmtExpr( StmtExpr * newValue ) { stmtExpr = newValue; return this; } … … 723 698 StmtExpr( CompoundStmt * statements ); 724 699 StmtExpr( const StmtExpr & other ); 725 virtual ~StmtExpr();726 700 727 701 CompoundStmt * get_statements() const { return statements; } … … 748 722 UniqueExpr( Expression * expr, long long idVal = -1 ); 749 723 UniqueExpr( const UniqueExpr & other ); 750 ~UniqueExpr();751 724 752 725 Expression * get_expr() const { return expr; } … … 778 751 InitAlternative( const InitAlternative & other ); 779 752 InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it 780 ~InitAlternative();781 753 }; 782 754 … … 788 760 UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts ); 789 761 UntypedInitExpr( const UntypedInitExpr & other ); 790 ~UntypedInitExpr();791 762 792 763 Expression * get_expr() const { return expr; } … … 808 779 InitExpr( Expression * expr, Designation * designation ); 809 780 InitExpr( const InitExpr & other ); 810 ~InitExpr();811 781 812 782 Expression * get_expr() const { return expr; } … … 830 800 DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ); 831 801 DeletedExpr( const DeletedExpr & other ); 832 ~DeletedExpr();833 802 834 803 virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); } -
src/SynTree/FunctionDecl.cc
r6171841 r68f9c43 52 52 } 53 53 cloneAll( other.withExprs, withExprs ); 54 }55 56 FunctionDecl::~FunctionDecl() {57 delete type;58 delete statements;59 deleteAll( withExprs );60 54 } 61 55 -
src/SynTree/FunctionType.cc
r6171841 r68f9c43 31 31 cloneAll( other.returnVals, returnVals ); 32 32 cloneAll( other.parameters, parameters ); 33 }34 35 FunctionType::~FunctionType() {36 deleteAll( returnVals );37 deleteAll( parameters );38 33 } 39 34 -
src/SynTree/Initializer.cc
r6171841 r68f9c43 32 32 } 33 33 34 Designation::~Designation() {35 // std::cerr << "destroying designation" << std::endl;36 deleteAll( designators );37 // std::cerr << "finished destroying designation" << std::endl;38 }39 40 34 void Designation::print( std::ostream &os, Indenter indent ) const { 41 35 if ( ! designators.empty() ) { … … 52 46 Initializer::Initializer( const Initializer & other ) : BaseSyntaxNode( other ), maybeConstructed( other.maybeConstructed ) { 53 47 } 54 Initializer::~Initializer() {}55 48 56 49 SingleInit::SingleInit( Expression *v, bool maybeConstructed ) : Initializer( maybeConstructed ), value ( v ) { … … 58 51 59 52 SingleInit::SingleInit( const SingleInit &other ) : Initializer(other), value ( maybeClone( other.value ) ) { 60 }61 62 SingleInit::~SingleInit() {63 delete value;64 53 } 65 54 … … 87 76 } 88 77 89 ListInit::~ListInit() {90 deleteAll( initializers );91 deleteAll( designations );92 }93 94 78 void ListInit::print( std::ostream &os, Indenter indent ) const { 95 79 os << "Compound initializer: " << std::endl; … … 110 94 ConstructorInit::ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ) : Initializer( true ), ctor( ctor ), dtor( dtor ), init( init ) {} 111 95 ConstructorInit::ConstructorInit( const ConstructorInit &other ) : Initializer( other ), ctor( maybeClone( other.ctor ) ), dtor( maybeClone( other.dtor ) ), init( maybeClone( other.init ) ) { 112 }113 114 ConstructorInit::~ConstructorInit() {115 delete ctor;116 delete dtor;117 delete init;118 96 } 119 97 -
src/SynTree/Initializer.h
r6171841 r68f9c43 33 33 Designation( const std::list< Expression * > & designators ); 34 34 Designation( const Designation & other ); 35 virtual ~Designation();36 35 37 36 std::list< Expression * > & get_designators() { return designators; } … … 50 49 Initializer( bool maybeConstructed ); 51 50 Initializer( const Initializer & other ); 52 virtual ~Initializer();53 51 54 52 bool get_maybeConstructed() { return maybeConstructed; } … … 70 68 SingleInit( Expression *value, bool maybeConstructed = false ); 71 69 SingleInit( const SingleInit &other ); 72 virtual ~SingleInit();73 70 74 71 Expression *get_value() { return value; } … … 91 88 const std::list<Designation *> &designators = {}, bool maybeConstructed = false ); 92 89 ListInit( const ListInit & other ); 93 virtual ~ListInit();94 90 95 91 std::list<Designation *> & get_designations() { return designations; } … … 123 119 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); 124 120 ConstructorInit( const ConstructorInit &other ); 125 virtual ~ConstructorInit();126 121 127 122 void set_ctor( Statement * newValue ) { ctor = newValue; } -
src/SynTree/NamedTypeDecl.cc
r6171841 r68f9c43 30 30 cloneAll( other.parameters, parameters ); 31 31 cloneAll( other.assertions, assertions ); 32 }33 34 NamedTypeDecl::~NamedTypeDecl() {35 delete base;36 deleteAll( parameters );37 deleteAll( assertions );38 32 } 39 33 -
src/SynTree/ObjectDecl.cc
r6171841 r68f9c43 32 32 ObjectDecl::ObjectDecl( const ObjectDecl &other ) 33 33 : Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ) { 34 }35 36 ObjectDecl::~ObjectDecl() {37 delete type;38 delete init;39 delete bitfieldWidth;40 34 } 41 35 -
src/SynTree/PointerType.cc
r6171841 r68f9c43 36 36 } 37 37 38 PointerType::~PointerType() {39 delete base;40 delete dimension;41 }42 43 38 void PointerType::print( std::ostream &os, Indenter indent ) const { 44 39 Type::print( os, indent ); -
src/SynTree/ReferenceToType.cc
r6171841 r68f9c43 32 32 ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ), hoistType( other.hoistType ) { 33 33 cloneAll( other.parameters, parameters ); 34 }35 36 ReferenceToType::~ReferenceToType() {37 deleteAll( parameters );38 34 } 39 35 … … 170 166 } 171 167 172 TraitInstType::~TraitInstType() {173 }174 175 168 bool TraitInstType::isComplete() const { assert( false ); } 176 169 … … 183 176 184 177 TypeInstType::TypeInstType( const TypeInstType &other ) : Parent( other ), baseType( other.baseType ), isFtype( other.isFtype ) { 185 }186 187 188 TypeInstType::~TypeInstType() {189 // delete baseType; //This is shared and should not be deleted190 178 } 191 179 -
src/SynTree/ReferenceType.cc
r6171841 r68f9c43 28 28 } 29 29 30 ReferenceType::~ReferenceType() {31 delete base;32 }33 34 30 int ReferenceType::referenceDepth() const { 35 31 return base->referenceDepth()+1; -
src/SynTree/Statement.cc
r6171841 r68f9c43 44 44 } 45 45 46 Statement::~Statement() {}47 48 46 ExprStmt::ExprStmt( Expression *expr ) : Statement(), expr( expr ) {} 49 47 50 48 ExprStmt::ExprStmt( const ExprStmt &other ) : Statement( other ), expr( maybeClone( other.expr ) ) {} 51 52 ExprStmt::~ExprStmt() {53 delete expr;54 }55 49 56 50 void ExprStmt::print( std::ostream &os, Indenter indent ) const { … … 66 60 cloneAll( other.input, input ); 67 61 cloneAll( other.clobber, clobber ); 68 }69 70 AsmStmt::~AsmStmt() {71 delete instruction;72 deleteAll( output );73 deleteAll( input );74 deleteAll( clobber );75 62 } 76 63 … … 122 109 ReturnStmt::ReturnStmt( const ReturnStmt & other ) : Statement( other ), expr( maybeClone( other.expr ) ) {} 123 110 124 ReturnStmt::~ReturnStmt() {125 delete expr;126 }127 128 111 void ReturnStmt::print( std::ostream &os, Indenter indent ) const { 129 112 os << "Return Statement, returning: "; … … 141 124 Statement( other ), condition( maybeClone( other.condition ) ), thenPart( maybeClone( other.thenPart ) ), elsePart( maybeClone( other.elsePart ) ) { 142 125 cloneAll( other.initialization, initialization ); 143 }144 145 IfStmt::~IfStmt() {146 deleteAll( initialization );147 delete condition;148 delete thenPart;149 delete elsePart;150 126 } 151 127 … … 185 161 } 186 162 187 SwitchStmt::~SwitchStmt() {188 delete condition;189 // destroy statements190 deleteAll( statements );191 }192 193 163 void SwitchStmt::print( std::ostream &os, Indenter indent ) const { 194 164 os << "Switch on condition: "; … … 209 179 Statement( other ), condition( maybeClone(other.condition ) ), _isDefault( other._isDefault ) { 210 180 cloneAll( other.stmts, stmts ); 211 }212 213 CaseStmt::~CaseStmt() {214 delete condition;215 deleteAll( stmts );216 181 } 217 182 … … 243 208 } 244 209 245 WhileStmt::~WhileStmt() {246 delete body;247 delete condition;248 }249 250 210 void WhileStmt::print( std::ostream &os, Indenter indent ) const { 251 211 os << "While on condition: " << endl ; … … 265 225 cloneAll( other.initialization, initialization ); 266 226 267 }268 269 ForStmt::~ForStmt() {270 deleteAll( initialization );271 delete condition;272 delete increment;273 delete body;274 227 } 275 228 … … 311 264 ThrowStmt::ThrowStmt( const ThrowStmt &other ) : 312 265 Statement ( other ), kind( other.kind ), expr( maybeClone( other.expr ) ), target( maybeClone( other.target ) ) { 313 }314 315 ThrowStmt::~ThrowStmt() {316 delete expr;317 delete target;318 266 } 319 267 … … 336 284 } 337 285 338 TryStmt::~TryStmt() {339 delete block;340 deleteAll( handlers );341 delete finallyBlock;342 }343 344 286 void TryStmt::print( std::ostream &os, Indenter indent ) const { 345 287 os << "Try Statement" << endl; … … 370 312 } 371 313 372 CatchStmt::~CatchStmt() {373 delete decl;374 delete body;375 }376 377 314 void CatchStmt::print( std::ostream &os, Indenter indent ) const { 378 315 os << "Catch " << ((Terminate == kind) ? "Terminate" : "Resume") << " Statement" << endl; … … 397 334 398 335 FinallyStmt::FinallyStmt( const FinallyStmt & other ) : Statement( other ), block( maybeClone( other.block ) ) { 399 }400 401 FinallyStmt::~FinallyStmt() {402 delete block;403 336 } 404 337 … … 434 367 } 435 368 436 WaitForStmt::~WaitForStmt() {437 for( auto & clause : clauses ) {438 delete clause.target.function;439 deleteAll( clause.target.arguments );440 delete clause.statement;441 delete clause.condition;442 }443 444 delete timeout.time;445 delete timeout.statement;446 delete timeout.condition;447 448 delete orelse.statement;449 delete orelse.condition;450 }451 452 369 void WaitForStmt::print( std::ostream &os, Indenter indent ) const { 453 370 os << "Waitfor Statement" << endl; … … 460 377 WithStmt::WithStmt( const WithStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) { 461 378 cloneAll( other.exprs, exprs ); 462 }463 WithStmt::~WithStmt() {464 deleteAll( exprs );465 delete stmt;466 379 } 467 380 … … 489 402 } 490 403 491 ImplicitCtorDtorStmt::~ImplicitCtorDtorStmt() {492 delete callStmt;493 }494 495 404 void ImplicitCtorDtorStmt::print( std::ostream &os, Indenter indent ) const { 496 405 os << "Implicit Ctor Dtor Statement" << endl; -
src/SynTree/Statement.h
r6171841 r68f9c43 38 38 39 39 Statement( const std::list<Label> & labels = {} ); 40 virtual ~Statement();41 40 42 41 std::list<Label> & get_labels() { return labels; } … … 56 55 CompoundStmt( std::list<Statement *> stmts ); 57 56 CompoundStmt( const CompoundStmt &other ); 58 virtual ~CompoundStmt();59 57 60 58 std::list<Statement*>& get_kids() { return kids; } … … 84 82 ExprStmt( Expression *expr ); 85 83 ExprStmt( const ExprStmt &other ); 86 virtual ~ExprStmt();87 84 88 85 Expression *get_expr() { return expr; } … … 105 102 AsmStmt( bool voltile, Expression *instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ); 106 103 AsmStmt( const AsmStmt &other ); 107 virtual ~AsmStmt();108 104 109 105 bool get_voltile() { return voltile; } … … 136 132 std::list<Statement *> initialization = std::list<Statement *>() ); 137 133 IfStmt( const IfStmt &other ); 138 virtual ~IfStmt();139 134 140 135 std::list<Statement *> &get_initialization() { return initialization; } … … 159 154 SwitchStmt( Expression *condition, const std::list<Statement *> &statements ); 160 155 SwitchStmt( const SwitchStmt &other ); 161 virtual ~SwitchStmt();162 156 163 157 Expression *get_condition() { return condition; } … … 181 175 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException); 182 176 CaseStmt( const CaseStmt &other ); 183 virtual ~CaseStmt();184 177 185 178 static CaseStmt * makeDefault( const std::list<Label> & labels = {}, std::list<Statement *> stmts = std::list<Statement *>() ); … … 212 205 Statement *body, bool isDoWhile = false ); 213 206 WhileStmt( const WhileStmt &other ); 214 virtual ~WhileStmt();215 207 216 208 Expression *get_condition() { return condition; } … … 237 229 Expression *condition = 0, Expression *increment = 0, Statement *body = 0 ); 238 230 ForStmt( const ForStmt &other ); 239 virtual ~ForStmt();240 231 241 232 std::list<Statement *> &get_initialization() { return initialization; } … … 290 281 ReturnStmt( Expression *expr ); 291 282 ReturnStmt( const ReturnStmt &other ); 292 virtual ~ReturnStmt();293 283 294 284 Expression *get_expr() { return expr; } … … 311 301 ThrowStmt( Kind kind, Expression * expr, Expression * target = nullptr ); 312 302 ThrowStmt( const ThrowStmt &other ); 313 virtual ~ThrowStmt();314 303 315 304 Kind get_kind() { return kind; } … … 333 322 TryStmt( CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 ); 334 323 TryStmt( const TryStmt &other ); 335 virtual ~TryStmt();336 324 337 325 CompoundStmt *get_block() const { return block; } … … 360 348 Expression *cond, Statement *body ); 361 349 CatchStmt( const CatchStmt &other ); 362 virtual ~CatchStmt();363 350 364 351 Kind get_kind() { return kind; } … … 382 369 FinallyStmt( CompoundStmt *block ); 383 370 FinallyStmt( const FinallyStmt &other ); 384 virtual ~FinallyStmt();385 371 386 372 CompoundStmt *get_block() const { return block; } … … 409 395 WaitForStmt(); 410 396 WaitForStmt( const WaitForStmt & ); 411 virtual ~WaitForStmt();412 397 413 398 std::vector<Clause> clauses; … … 438 423 WithStmt( const std::list< Expression * > & exprs, Statement * stmt ); 439 424 WithStmt( const WithStmt & other ); 440 virtual ~WithStmt();441 425 442 426 virtual WithStmt * clone() const override { return new WithStmt( *this ); } … … 454 438 DeclStmt( Declaration *decl ); 455 439 DeclStmt( const DeclStmt &other ); 456 virtual ~DeclStmt();457 440 458 441 Declaration *get_decl() const { return decl; } … … 476 459 ImplicitCtorDtorStmt( Statement * callStmt ); 477 460 ImplicitCtorDtorStmt( const ImplicitCtorDtorStmt & other ); 478 virtual ~ImplicitCtorDtorStmt();479 461 480 462 Statement *get_callStmt() const { return callStmt; } -
src/SynTree/TupleExpr.cc
r6171841 r68f9c43 35 35 } 36 36 37 UntypedTupleExpr::~UntypedTupleExpr() {38 deleteAll( exprs );39 }40 41 37 void UntypedTupleExpr::print( std::ostream &os, Indenter indent ) const { 42 38 os << "Untyped Tuple:" << std::endl; … … 51 47 TupleExpr::TupleExpr( const TupleExpr &other ) : Expression( other ) { 52 48 cloneAll( other.exprs, exprs ); 53 }54 55 TupleExpr::~TupleExpr() {56 deleteAll( exprs );57 49 } 58 50 … … 72 64 73 65 TupleIndexExpr::TupleIndexExpr( const TupleIndexExpr &other ) : Expression( other ), tuple( other.tuple->clone() ), index( other.index ) { 74 }75 76 TupleIndexExpr::~TupleIndexExpr() {77 delete tuple;78 66 } 79 67 … … 105 93 } 106 94 107 TupleAssignExpr::~TupleAssignExpr() {108 delete stmtExpr;109 }110 111 95 void TupleAssignExpr::print( std::ostream &os, Indenter indent ) const { 112 96 os << "Tuple Assignment Expression, with stmt expr:" << std::endl; -
src/SynTree/TupleType.cc
r6171841 r68f9c43 43 43 } 44 44 45 TupleType::~TupleType() {46 deleteAll( types );47 deleteAll( members );48 }49 50 45 void TupleType::print( std::ostream &os, Indenter indent ) const { 51 46 Type::print( os, indent ); -
src/SynTree/Type.cc
r6171841 r68f9c43 57 57 } 58 58 59 Type::~Type() {60 deleteAll( forall );61 deleteAll( attributes );62 }63 64 59 // These must remain in the same order as the corresponding bit fields. 65 60 const char * Type::FuncSpecifiersNames[] = { "inline", "fortran", "_Noreturn" }; -
src/SynTree/Type.h
r6171841 r68f9c43 141 141 Type( const Qualifiers & tq, const std::list< Attribute * > & attributes ); 142 142 Type( const Type & other ); 143 virtual ~Type();144 143 145 144 Qualifiers & get_qualifiers() { return tq; } … … 261 260 PointerType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 262 261 PointerType( const PointerType& ); 263 virtual ~PointerType();264 262 265 263 Type *get_base() { return base; } … … 291 289 ArrayType( const Type::Qualifiers & tq, Type *base, Expression *dimension, bool isVarLen, bool isStatic, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 292 290 ArrayType( const ArrayType& ); 293 virtual ~ArrayType();294 291 295 292 Type *get_base() { return base; } … … 319 316 ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 320 317 ReferenceType( const ReferenceType & ); 321 virtual ~ReferenceType();322 318 323 319 Type *get_base() { return base; } … … 352 348 FunctionType( const Type::Qualifiers & tq, bool isVarArgs, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 353 349 FunctionType( const FunctionType& ); 354 virtual ~FunctionType();355 350 356 351 std::list<DeclarationWithType*> & get_returnVals() { return returnVals; } … … 376 371 ReferenceToType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes ); 377 372 ReferenceToType( const ReferenceToType & other ); 378 virtual ~ReferenceToType();379 373 380 374 const std::string & get_name() const { return name; } … … 503 497 TraitInstType( const Type::Qualifiers & tq, TraitDecl * baseTrait, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 504 498 TraitInstType( const TraitInstType & other ); 505 ~TraitInstType();506 499 507 500 virtual bool isComplete() const override; … … 525 518 TypeInstType( const Type::Qualifiers & tq, const std::string & name, bool isFtype, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 526 519 TypeInstType( const TypeInstType & other ); 527 ~TypeInstType();528 520 529 521 TypeDecl *get_baseType() const { return baseType; } … … 549 541 TupleType( const Type::Qualifiers & tq, const std::list< Type * > & types, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 550 542 TupleType( const TupleType& ); 551 virtual ~TupleType();552 543 553 544 typedef std::list<Type*> value_type; … … 583 574 TypeofType( const Type::Qualifiers & tq, Expression *expr, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 584 575 TypeofType( const TypeofType& ); 585 virtual ~TypeofType();586 576 587 577 Expression *get_expr() const { return expr; } … … 606 596 AttrType( const Type::Qualifiers & tq, const std::string & name, Type *type, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 607 597 AttrType( const AttrType& ); 608 virtual ~AttrType();609 598 610 599 const std::string & get_name() const { return name; } -
src/SynTree/TypeDecl.cc
r6171841 r68f9c43 25 25 26 26 TypeDecl::TypeDecl( const TypeDecl &other ) : Parent( other ), init( maybeClone( other.init ) ), sized( other.sized ), kind( other.kind ) { 27 }28 29 TypeDecl::~TypeDecl() {30 delete init;31 27 } 32 28 -
src/SynTree/TypeExpr.cc
r6171841 r68f9c43 26 26 } 27 27 28 TypeExpr::~TypeExpr() {29 delete type;30 }31 32 28 void TypeExpr::print( std::ostream &os, Indenter indent ) const { 33 29 if ( type ) type->print( os, indent ); -
src/SynTree/TypeSubstitution.cc
r6171841 r68f9c43 26 26 } 27 27 28 TypeSubstitution::~TypeSubstitution() {29 for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {30 delete( i->second );31 }32 for ( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {33 delete( i->second );34 }35 }36 37 28 TypeSubstitution &TypeSubstitution::operator=( const TypeSubstitution &other ) { 38 29 if ( this == &other ) return *this; … … 57 48 58 49 void TypeSubstitution::add( std::string formalType, Type *actualType ) { 59 TypeEnvType::iterator i = typeEnv.find( formalType );60 if ( i != typeEnv.end() ) {61 delete i->second;62 } // if63 50 typeEnv[ formalType ] = actualType->clone(); 64 51 } 65 52 66 53 void TypeSubstitution::remove( std::string formalType ) { 67 TypeEnvType::iterator i = typeEnv.find( formalType ); 68 if ( i != typeEnv.end() ) { 69 delete i->second; 70 typeEnv.erase( formalType ); 71 } // if 54 typeEnv.erase( formalType ); 72 55 } 73 56 … … 155 138 Type * newtype = i->second->clone(); 156 139 newtype->get_qualifiers() |= inst->get_qualifiers(); 157 delete inst;158 140 return newtype; 159 141 } // if … … 166 148 } else { 167 149 subCount++; 168 delete nameExpr;169 150 return i->second->clone(); 170 151 } // if -
src/SynTree/TypeSubstitution.h
r6171841 r68f9c43 35 35 TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ); 36 36 TypeSubstitution( const TypeSubstitution &other ); 37 virtual ~TypeSubstitution();38 37 39 38 TypeSubstitution &operator=( const TypeSubstitution &other ); … … 101 100 if ( TypeExpr *actual = dynamic_cast< TypeExpr* >( *actualIt ) ) { 102 101 if ( formal->get_name() != "" ) { 103 TypeEnvType::iterator i = typeEnv.find( formal->get_name() );104 if ( i != typeEnv.end() ) {105 delete i->second;106 } // if107 102 typeEnv[ formal->get_name() ] = actual->get_type()->clone(); 108 103 } // if -
src/SynTree/TypeofType.cc
r6171841 r68f9c43 29 29 } 30 30 31 TypeofType::~TypeofType() {32 delete expr;33 }34 35 31 void TypeofType::print( std::ostream &os, Indenter indent ) const { 36 32 Type::print( os, indent ); -
src/SynTree/module.mk
r6171841 r68f9c43 48 48 SynTree/TypeSubstitution.cc \ 49 49 SynTree/Attribute.cc \ 50 SynTree/GcTracer.cc \ 50 51 SynTree/VarExprReplacer.cc 51 52
Note:
See TracChangeset
for help on using the changeset viewer.