Changeset 4b2589a
- Timestamp:
- Jun 29, 2016, 12:41:56 PM (7 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
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r982d63f r4b2589a 750 750 void CodeGenerator::visit( ReturnStmt *returnStmt ) { 751 751 output << "return "; 752 753 // xxx -- check for null expression; 754 if ( returnStmt->get_expr() ) { 755 returnStmt->get_expr()->accept( *this ); 756 } // if 752 maybeAccept( returnStmt->get_expr(), *this ); 757 753 output << ";"; 758 754 } -
src/ControlStruct/MLEMutator.cc
r982d63f r4b2589a 166 166 throw SemanticError("The label defined in the exit loop statement does not exist: " + originalTarget ); // shouldn't happen (since that's already checked) 167 167 } 168 169 // xxx - possibly remove this170 // what about exiting innermost block or switch???171 // if ( enclosingControlStructures.back() == (*targetEntry) )172 // return branchStmt; // exit the innermost loop (labels unnecessary)173 168 174 169 // branch error checks, get the appropriate label name and create a goto -
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 ) ); -
src/SynTree/Label.h
r982d63f r4b2589a 21 21 #include <iostream> 22 22 #include "SynTree.h" 23 24 // Label needs to know25 // * how deeply nested it is (scopeLevel)26 // * relative position in a scope compared with other labels (index?)27 // * either the original label it was generated from or the labels it generates (for labelled break/continue)28 23 29 24 class Label {
Note: See TracChangeset
for help on using the changeset viewer.