Ignore:
Timestamp:
Dec 16, 2014, 9:41:50 PM (10 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, 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:
17cd4eb
Parents:
3848e0e
Message:

remove Parser.old, add -XCFA to driver, copy ptrdiff_t from stddef.h in preclude, remove casts from initialization constants, adjust formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/ControlStruct/ForExprMutator.cc

    r3848e0e rd9a0e76  
    44
    55namespace ControlStruct {
    6   Statement* ForExprMutator::mutate(ForStmt *forStmt)
    7   {
    8     DeclStmt *decl;
    9     if (( decl = dynamic_cast< DeclStmt * > ( forStmt->get_initialization() )) != 0 )
    10       {
    11         // create compound statement, move declaration outside, leave _for_ as-is
    12         CompoundStmt *block = new CompoundStmt( std::list< Label >() );
    13         std::list<Statement *> &stmts = block->get_kids();
     6    Statement *ForExprMutator::mutate( ForStmt *forStmt ) {
     7        DeclStmt *decl;
     8        if (( decl = dynamic_cast< DeclStmt * > ( forStmt->get_initialization() )) != 0 ) {
     9            // create compound statement, move declaration outside, leave _for_ as-is
     10            CompoundStmt *block = new CompoundStmt( std::list< Label >() );
     11            std::list<Statement *> &stmts = block->get_kids();
    1412
    15         stmts.push_back( decl );
    16         forStmt->set_initialization( 0 );
    17         stmts.push_back( forStmt );
     13            stmts.push_back( decl );
     14            forStmt->set_initialization( 0 );
     15            stmts.push_back( forStmt );
    1816
    19         return block;
    20       }
    21     // ForStmt still needs to be fixed
    22     else
    23       return forStmt;
    24   }
    25 
     17            return block;
     18        } // if
     19        // ForStmt still needs to be fixed
     20        else
     21            return forStmt;
     22    }
    2623} // namespace ControlStruct
Note: See TracChangeset for help on using the changeset viewer.