Changes in src/GenPoly/PolyMutator.cc [45a4ea7:fc638d2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/PolyMutator.cc
r45a4ea7 rfc638d2 50 50 51 51 Statement * PolyMutator::mutateStatement( Statement *stmt ) { 52 // don't want statements from outer CompoundStmts to be added to this CompoundStmt53 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 59 52 Statement *newStmt = maybeMutate( stmt, *this ); 60 53 if ( ! stmtsToAdd.empty() || ! stmtsToAddAfter.empty() ) { … … 90 83 91 84 Statement * PolyMutator::mutate(IfStmt *ifStmt) { 92 ifStmt->set_condition( mutateExpression( ifStmt->get_condition() ) );93 85 ifStmt->set_thenPart( mutateStatement( ifStmt->get_thenPart() ) ); 94 86 ifStmt->set_elsePart( mutateStatement( ifStmt->get_elsePart() ) ); 87 ifStmt->set_condition( mutateExpression( ifStmt->get_condition() ) ); 95 88 return ifStmt; 96 89 } 97 90 98 91 Statement * PolyMutator::mutate(WhileStmt *whileStmt) { 92 whileStmt->set_body( mutateStatement( whileStmt->get_body() ) ); 99 93 whileStmt->set_condition( mutateExpression( whileStmt->get_condition() ) ); 100 whileStmt->set_body( mutateStatement( whileStmt->get_body() ) );101 94 return whileStmt; 102 95 } 103 96 104 97 Statement * PolyMutator::mutate(ForStmt *forStmt) { 98 forStmt->set_body( mutateStatement( forStmt->get_body() ) ); 105 99 mutateAll( forStmt->get_initialization(), *this ); 106 100 forStmt->set_condition( mutateExpression( forStmt->get_condition() ) ); 107 101 forStmt->set_increment( mutateExpression( forStmt->get_increment() ) ); 108 forStmt->set_body( mutateStatement( forStmt->get_body() ) );109 102 return forStmt; 110 103 } 111 104 112 105 Statement * PolyMutator::mutate(SwitchStmt *switchStmt) { 106 mutateStatementList( switchStmt->get_statements() ); 113 107 switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) ); 114 mutateStatementList( switchStmt->get_statements() );115 108 return switchStmt; 116 109 } 117 110 118 111 Statement * PolyMutator::mutate(CaseStmt *caseStmt) { 112 mutateStatementList( caseStmt->get_statements() ); 119 113 caseStmt->set_condition( mutateExpression( caseStmt->get_condition() ) ); 120 mutateStatementList( caseStmt->get_statements() );121 114 return caseStmt; 122 115 }
Note: See TracChangeset
for help on using the changeset viewer.