Changes in / [bb86117:0423f25]
- Location:
- src
- Files:
-
- 2 edited
-
CodeGen/CodeGenerator.cc (modified) (7 diffs)
-
ControlStruct/MLEMutator.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rbb86117 r0423f25 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Jun 04 15:00:00201513 // Update Count : 12 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 4 14:05:45 2015 13 // Update Count : 120 14 14 // 15 15 … … 483 483 484 484 void CodeGenerator::visit( SwitchStmt *switchStmt ) { 485 //output << /* "\r" << */ string( cur_indent, ' ' ) << CodeGenerator::printLabels( switchStmt->get_labels() ) 485 486 output << "switch (" ; 486 487 switchStmt->get_condition()->accept(*this ); … … 499 500 void CodeGenerator::visit( CaseStmt *caseStmt ) { 500 501 output << string( cur_indent, ' ' ); 501 if ( caseStmt->isDefault()) {502 if ( caseStmt->isDefault()) 502 503 output << "default"; 503 }else {504 else { 504 505 output << "case "; 505 506 caseStmt->get_condition()->accept(*this ); … … 511 512 cur_indent += CodeGenerator::tabsize; 512 513 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 513 output << string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() ) ;514 output << /* "\r" << */ string( cur_indent, ' ' ) << printLabels( (*i)->get_labels() ) ; 514 515 (*i)->accept(*this ); 515 516 output << endl; … … 519 520 520 521 void CodeGenerator::visit( BranchStmt *branchStmt ) { 522 output << "\r" << string( cur_indent, ' ' ); 523 output << CodeGenerator::printLabels( branchStmt->get_labels()); 524 521 525 switch ( branchStmt->get_type()) { 522 526 case BranchStmt::Goto: … … 564 568 whileStmt->get_body()->accept( *this ); 565 569 566 output << string( cur_indent, ' ' );570 output << /* "\r" << */ string( cur_indent, ' ' ); 567 571 568 572 if ( whileStmt->get_isDoWhile() ) { … … 596 600 597 601 void CodeGenerator::visit( NullStmt *nullStmt ) { 598 //output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() );602 //output << /* "\r" << */ string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() ); 599 603 output << "/* null statement */ ;"; 600 604 } -
src/ControlStruct/MLEMutator.cc
rbb86117 r0423f25 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 04 15:12:33201513 // Update Count : 17 312 // Last Modified On : Wed Jun 03 15:09:27 2015 13 // Update Count : 170 14 14 // 15 15 … … 52 52 bool labeledBlock = !(cmpndStmt->get_labels().empty()); 53 53 if ( labeledBlock ) { 54 Label brkLabel = generator->newLabel( "blockBreak");54 Label brkLabel = generator->newLabel(); 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 determine whether brkLabel 78 // and contLabel are used with branch statements 77 // the body of the loop -- this will do SOMETHING with branch statements 79 78 // and will recursively do the same to nested loops 80 79 Label brkLabel = generator->newLabel("loopBreak"); … … 87 86 assert ( e == loopStmt ); 88 87 89 // this will take the necessary steps to add definitions of the previous 90 // two labels, if they are used. 88 // generate labels as needed 91 89 loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) ); 92 90 enclosingLoops.pop_back();
Note:
See TracChangeset
for help on using the changeset viewer.