Ignore:
Timestamp:
Jun 4, 2015, 3:13:53 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, string, with_gc
Children:
bb86117
Parents:
9a8930f
Message:

removed carriage returns from code generation and some duplicate label printing, more MLE documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r9a8930f reb3261f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  4 14:05:45 2015
    13 // Update Count     : 120
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Thu Jun 04 15:00:00 2015
     13// Update Count     : 125
    1414//
    1515
     
    483483
    484484        void CodeGenerator::visit( SwitchStmt *switchStmt ) {
    485                 //output << /* "\r" << */ string( cur_indent, ' ' ) << CodeGenerator::printLabels( switchStmt->get_labels() )
    486485                output << "switch (" ;
    487486                switchStmt->get_condition()->accept(*this );
     
    500499        void CodeGenerator::visit( CaseStmt *caseStmt ) {
    501500                output << string( cur_indent, ' ' );
    502                 if ( caseStmt->isDefault())
     501                if ( caseStmt->isDefault()) {
    503502                        output << "default";
    504                 else {
     503                } else {
    505504                        output << "case ";
    506505                        caseStmt->get_condition()->accept(*this );
     
    512511                cur_indent += CodeGenerator::tabsize;
    513512                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() )  ;
    515514                        (*i)->accept(*this );
    516515                        output << endl;
     
    520519
    521520        void CodeGenerator::visit( BranchStmt *branchStmt ) {
    522                 output << "\r" << string( cur_indent, ' ' );
    523                 output << CodeGenerator::printLabels( branchStmt->get_labels());
    524 
    525521                switch ( branchStmt->get_type()) {
    526522                  case BranchStmt::Goto:
     
    568564                whileStmt->get_body()->accept( *this );
    569565
    570                 output << /* "\r" << */ string( cur_indent, ' ' );
     566                output << string( cur_indent, ' ' );
    571567
    572568                if ( whileStmt->get_isDoWhile() ) {
     
    600596
    601597        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() );
    603599                output << "/* null statement */ ;";
    604600        }
Note: See TracChangeset for help on using the changeset viewer.