Changeset 4b2589a for src/InitTweak/FixInit.cc
- Timestamp:
- Jun 29, 2016, 12:41:56 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 85f0713
- Parents:
- 982d63f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r982d63f r4b2589a 496 496 497 497 void ObjDeclCollector::visit( DeclStmt *stmt ) { 498 // keep track of all variables currently in scope 498 499 if ( ObjectDecl * objDecl = dynamic_cast< ObjectDecl * > ( stmt->get_decl() ) ) { 499 500 curVars.insert( objDecl ); … … 503 504 504 505 void LabelFinder::handleStmt( Statement * stmt ) { 506 // for each label, remember the variables in scope at that label. 505 507 for ( Label l : stmt->get_labels() ) { 506 508 vars[l] = curVars; … … 549 551 Parent::visit( compoundStmt ); 550 552 553 // add destructors for the current scope that we're exiting 551 554 std::list< Statement * > & statements = compoundStmt->get_kids(); 552 555 insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) ); 553 554 // xxx - ??555 // deleteAll( dtorStmts.back() );556 556 reverseDeclOrder.pop_front(); 557 557 } 558 558 559 559 void InsertDtors::visit( ReturnStmt * returnStmt ) { 560 // return exits all scopes, so dump destructors for all scopes 560 561 for ( OrderedDecls & od : reverseDeclOrder ) { 561 562 insertDtors( od.begin(), od.end(), back_inserter( stmtsToAdd ) );
Note: See TracChangeset
for help on using the changeset viewer.