Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/PolyMutator.cc

    r45a4ea7 rfc638d2  
    5050
    5151        Statement * PolyMutator::mutateStatement( Statement *stmt ) {
    52                 // don't want statements from outer CompoundStmts to be added to this CompoundStmt
    53                 ValueGuard< std::list< Statement* > > oldStmtsToAdd( stmtsToAdd );
    54                 ValueGuard< std::list< Statement* > > oldStmtsToAddAfter( stmtsToAddAfter );
    55                 ValueGuard< TypeSubstitution * > oldEnv( env );
    56                 stmtsToAdd.clear();
    57                 stmtsToAddAfter.clear();
    58 
    5952                Statement *newStmt = maybeMutate( stmt, *this );
    6053                if ( ! stmtsToAdd.empty() || ! stmtsToAddAfter.empty() ) {
     
    9083
    9184        Statement * PolyMutator::mutate(IfStmt *ifStmt) {
    92                 ifStmt->set_condition(  mutateExpression( ifStmt->get_condition() ) );
    9385                ifStmt->set_thenPart(  mutateStatement( ifStmt->get_thenPart() ) );
    9486                ifStmt->set_elsePart(  mutateStatement( ifStmt->get_elsePart() ) );
     87                ifStmt->set_condition(  mutateExpression( ifStmt->get_condition() ) );
    9588                return ifStmt;
    9689        }
    9790
    9891        Statement * PolyMutator::mutate(WhileStmt *whileStmt) {
     92                whileStmt->set_body(  mutateStatement( whileStmt->get_body() ) );
    9993                whileStmt->set_condition(  mutateExpression( whileStmt->get_condition() ) );
    100                 whileStmt->set_body(  mutateStatement( whileStmt->get_body() ) );
    10194                return whileStmt;
    10295        }
    10396
    10497        Statement * PolyMutator::mutate(ForStmt *forStmt) {
     98                forStmt->set_body(  mutateStatement( forStmt->get_body() ) );
    10599                mutateAll( forStmt->get_initialization(), *this );
    106100                forStmt->set_condition(  mutateExpression( forStmt->get_condition() ) );
    107101                forStmt->set_increment(  mutateExpression( forStmt->get_increment() ) );
    108                 forStmt->set_body(  mutateStatement( forStmt->get_body() ) );
    109102                return forStmt;
    110103        }
    111104
    112105        Statement * PolyMutator::mutate(SwitchStmt *switchStmt) {
     106                mutateStatementList( switchStmt->get_statements() );
    113107                switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) );
    114                 mutateStatementList( switchStmt->get_statements() );
    115108                return switchStmt;
    116109        }
    117110
    118111        Statement * PolyMutator::mutate(CaseStmt *caseStmt) {
     112                mutateStatementList( caseStmt->get_statements() );
    119113                caseStmt->set_condition(  mutateExpression( caseStmt->get_condition() ) );
    120                 mutateStatementList( caseStmt->get_statements() );
    121114                return caseStmt;
    122115        }
Note: See TracChangeset for help on using the changeset viewer.