Changeset 3778cb2


Ignore:
Timestamp:
Jul 30, 2016, 3:28:40 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, 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:
057b34f
Parents:
ac911f4
Message:

case range clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rac911f4 r3778cb2  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 30 11:27:07 2016
    13 // Update Count     : 340
     12// Last Modified On : Sat Jul 30 14:59:34 2016
     13// Update Count     : 341
    1414//
    1515
     
    155155                        objectDecl->get_init()->accept( *this );
    156156                } // if
     157
    157158                if ( objectDecl->get_bitfieldWidth() ) {
    158159                        output << ":";
     
    172173
    173174                        cur_indent += CodeGenerator::tabsize;
    174                         for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
     175                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++ ) {
    175176                                output << indent;
    176177                                (*i)->accept( *this );
    177178                                output << ";" << endl;
    178                         }
     179                        } // for
    179180
    180181                        cur_indent -= CodeGenerator::tabsize;
     
    257258                                (*iter)->accept( *this );
    258259                                output << "]";
    259                         }
    260                 }
     260                        } // if
     261                } // for
    261262                output << " = ";
    262263        }
     
    317318                                        // do nothing
    318319                                        ;
    319                                 }
     320                                } // switch
    320321
    321322                                switch ( opInfo.type ) {
     
    385386                                        // there are no intrinsic definitions of 0/1 or label addresses as functions
    386387                                        assert( false );
    387                                 }
     388                                } // switch
    388389                        } else {
    389390                                varExpr->accept( *this );
     
    437438                                                // no constructors with 0 or more than 2 parameters
    438439                                                assert( false );
    439                                         }
     440                                        } // if
    440441                                        break;
    441442
     
    470471                                        // there are no intrinsic definitions of 0 or 1 as functions
    471472                                        assert( false );
    472                                 }
     473                                } // switch
    473474                        } else {
    474                                 if ( nameExpr->get_name() != "Range" ) {
    475                                         // builtin routines
     475                                if ( nameExpr->get_name() != "Range" ) { // builtin routines
    476476                                        nameExpr->accept( *this );
    477477                                        output << "(";
    478478                                        genCommaList( untypedExpr->get_args().begin(), untypedExpr->get_args().end() );
    479479                                        output << ")";
    480                                 } else {
    481                                         // case V1 ... V2 or case V1~V2
     480                                } else {                                                                // case V1 ... V2 or case V1~V2
    482481                                        assert( untypedExpr->get_args().size() == 2 );
    483482                                        (*untypedExpr->get_args().begin())->accept( *this );
     
    530529                        // otherwise, the cast is to an lvalue type, so the cast should be dropped, since the result of a cast is
    531530                        // never an lvalue in C
    532                 }
     531                } // if
    533532                castExpr->get_arg()->accept( *this );
    534533                output << ")";
     
    663662                        if ( wantSpacing( *i ) ) {
    664663                                output << endl;
    665                         }
     664                        } // if
    666665                }
    667666                cur_indent -= CodeGenerator::tabsize;
     
    746745                        (*i)->accept( *this );
    747746                        output << endl;
    748                 }
     747                } // for
    749748                cur_indent -= CodeGenerator::tabsize;
    750749        }
     
    768767                        output << "continue";
    769768                        break;
    770                 }
     769                } // switch
    771770                output << ";";
    772771        }
     
    807806                if ( forStmt->get_condition() != 0 ) {
    808807                        forStmt->get_condition()->accept( *this );
    809                 }
     808                } // if
    810809                output << ";";
    811810
     
    814813                        Expression * expr = new CastExpr( forStmt->get_increment() );
    815814                        expr->accept( *this );
    816                 }
     815                } // if
    817816                output << ") ";
    818817
Note: See TracChangeset for help on using the changeset viewer.