Changes in / [bb86117:0423f25]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rbb86117 r0423f25  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Jun 04 15:00:00 2015
    13 // Update Count     : 125
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jun  4 14:05:45 2015
     13// Update Count     : 120
    1414//
    1515
     
    483483
    484484        void CodeGenerator::visit( SwitchStmt *switchStmt ) {
     485                //output << /* "\r" << */ string( cur_indent, ' ' ) << CodeGenerator::printLabels( switchStmt->get_labels() )
    485486                output << "switch (" ;
    486487                switchStmt->get_condition()->accept(*this );
     
    499500        void CodeGenerator::visit( CaseStmt *caseStmt ) {
    500501                output << string( cur_indent, ' ' );
    501                 if ( caseStmt->isDefault()) {
     502                if ( caseStmt->isDefault())
    502503                        output << "default";
    503                 } else {
     504                else {
    504505                        output << "case ";
    505506                        caseStmt->get_condition()->accept(*this );
     
    511512                cur_indent += CodeGenerator::tabsize;
    512513                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() )  ;
    514515                        (*i)->accept(*this );
    515516                        output << endl;
     
    519520
    520521        void CodeGenerator::visit( BranchStmt *branchStmt ) {
     522                output << "\r" << string( cur_indent, ' ' );
     523                output << CodeGenerator::printLabels( branchStmt->get_labels());
     524
    521525                switch ( branchStmt->get_type()) {
    522526                  case BranchStmt::Goto:
     
    564568                whileStmt->get_body()->accept( *this );
    565569
    566                 output << string( cur_indent, ' ' );
     570                output << /* "\r" << */ string( cur_indent, ' ' );
    567571
    568572                if ( whileStmt->get_isDoWhile() ) {
     
    596600
    597601        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() );
    599603                output << "/* null statement */ ;";
    600604        }
  • src/ControlStruct/MLEMutator.cc

    rbb86117 r0423f25  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Jun 04 15:12:33 2015
    13 // Update Count     : 173
     12// Last Modified On : Wed Jun 03 15:09:27 2015
     13// Update Count     : 170
    1414//
    1515
     
    5252                bool labeledBlock = !(cmpndStmt->get_labels().empty());
    5353                if ( labeledBlock ) {
    54                         Label brkLabel = generator->newLabel("blockBreak");
     54                        Label brkLabel = generator->newLabel();
    5555                        enclosingBlocks.push_back( Entry( cmpndStmt, brkLabel ) );
    5656                } // if
     
    7575        Statement *MLEMutator::handleLoopStmt( LoopClass *loopStmt ) {
    7676                // 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
    7978                // and will recursively do the same to nested loops
    8079                Label brkLabel = generator->newLabel("loopBreak");
     
    8786                assert ( e == loopStmt );
    8887
    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
    9189                loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) );
    9290                enclosingLoops.pop_back();
Note: See TracChangeset for help on using the changeset viewer.