Changeset bb86117
- Timestamp:
- Jun 4, 2015, 10:55:52 PM (9 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, string, with_gc
- Children:
- aa30dc0
- Parents:
- 0423f25 (diff), eb3261f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r0423f25 rbb86117 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jun 4 14:05:45201513 // Update Count : 12 011 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 04 15:00:00 2015 13 // Update Count : 125 14 14 // 15 15 … … 483 483 484 484 void CodeGenerator::visit( SwitchStmt *switchStmt ) { 485 //output << /* "\r" << */ string( cur_indent, ' ' ) << CodeGenerator::printLabels( switchStmt->get_labels() )486 485 output << "switch (" ; 487 486 switchStmt->get_condition()->accept(*this ); … … 500 499 void CodeGenerator::visit( CaseStmt *caseStmt ) { 501 500 output << string( cur_indent, ' ' ); 502 if ( caseStmt->isDefault()) 501 if ( caseStmt->isDefault()) { 503 502 output << "default"; 504 else {503 } else { 505 504 output << "case "; 506 505 caseStmt->get_condition()->accept(*this ); … … 512 511 cur_indent += CodeGenerator::tabsize; 513 512 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 514 output << /* "\r" << */string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() ) ;513 output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() ) ; 515 514 (*i)->accept(*this ); 516 515 output << endl; … … 520 519 521 520 void CodeGenerator::visit( BranchStmt *branchStmt ) { 522 output << "\r" << string( cur_indent, ' ' );523 output << CodeGenerator::printLabels( branchStmt->get_labels());524 525 521 switch ( branchStmt->get_type()) { 526 522 case BranchStmt::Goto: … … 568 564 whileStmt->get_body()->accept( *this ); 569 565 570 output << /* "\r" << */string( cur_indent, ' ' );566 output << string( cur_indent, ' ' ); 571 567 572 568 if ( whileStmt->get_isDoWhile() ) { … … 600 596 601 597 void CodeGenerator::visit( NullStmt *nullStmt ) { 602 //output << /* "\r" << */string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() );598 //output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() ); 603 599 output << "/* null statement */ ;"; 604 600 } -
src/ControlStruct/MLEMutator.cc
r0423f25 rbb86117 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jun 03 15:09:27201513 // Update Count : 17 012 // Last Modified On : Thu Jun 04 15:12:33 2015 13 // Update Count : 173 14 14 // 15 15 … … 52 52 bool labeledBlock = !(cmpndStmt->get_labels().empty()); 53 53 if ( labeledBlock ) { 54 Label brkLabel = generator->newLabel( );54 Label brkLabel = generator->newLabel("blockBreak"); 55 55 enclosingBlocks.push_back( Entry( cmpndStmt, brkLabel ) ); 56 56 } // if … … 75 75 Statement *MLEMutator::handleLoopStmt( LoopClass *loopStmt ) { 76 76 // remember this as the most recent enclosing loop, then mutate 77 // the body of the loop -- this will do SOMETHING with branch statements 77 // the body of the loop -- this will determine whether brkLabel 78 // and contLabel are used with branch statements 78 79 // and will recursively do the same to nested loops 79 80 Label brkLabel = generator->newLabel("loopBreak"); … … 86 87 assert ( e == loopStmt ); 87 88 88 // generate labels as needed 89 // this will take the necessary steps to add definitions of the previous 90 // two labels, if they are used. 89 91 loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) ); 90 92 enclosingLoops.pop_back();
Note: See TracChangeset
for help on using the changeset viewer.