Changes in src/GenPoly/PolyMutator.cc [8688ce1:09f800b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/PolyMutator.cc
r8688ce1 r09f800b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // PolyMutator.cc -- 7 // PolyMutator.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Aug 4 11:26:22 201613 // Update Count : 1 611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri Aug 14 15:28:50 2015 13 // Update Count : 11 14 14 // 15 15 … … 27 27 } 28 28 29 PolyMutator::PolyMutator() : scopeTyVars( (TypeDecl::Kind)-1 ), env( 0 ) {} 29 PolyMutator::PolyMutator() : env( 0 ) { 30 } 30 31 31 32 void PolyMutator::mutateStatementList( std::list< Statement* > &statements ) { … … 63 64 env = expr->get_env(); 64 65 } 65 // xxx - should env be cloned (or moved) onto the result of the mutate?66 66 return expr->acceptMutator( *this ); 67 67 } else { … … 99 99 100 100 Statement * PolyMutator::mutate(SwitchStmt *switchStmt) { 101 mutateStatementList( switchStmt->get_statements() ); 101 mutateStatementList( switchStmt->get_branches() ); 102 switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) ); 103 return switchStmt; 104 } 105 106 Statement * PolyMutator::mutate(ChooseStmt *switchStmt) { 107 mutateStatementList( switchStmt->get_branches() ); 102 108 switchStmt->set_condition( mutateExpression( switchStmt->get_condition() ) ); 103 109 return switchStmt; … … 139 145 return untypedExpr; 140 146 } 141 142 147 148 143 149 Initializer *PolyMutator::mutate( SingleInit *singleInit ) { 144 150 singleInit->set_value( mutateExpression( singleInit->get_value() ) ); … … 146 152 } 147 153 154 155 /* static class method */ 156 void PolyMutator::makeTyVarMap( Type *type, TyVarMap &tyVarMap ) { 157 for ( std::list< TypeDecl* >::const_iterator tyVar = type->get_forall().begin(); tyVar != type->get_forall().end(); ++tyVar ) { 158 assert( *tyVar ); 159 tyVarMap[ (*tyVar)->get_name() ] = (*tyVar)->get_kind(); 160 } 161 if ( PointerType *pointer = dynamic_cast< PointerType* >( type ) ) { 162 makeTyVarMap( pointer->get_base(), tyVarMap ); 163 } 164 } 148 165 } // namespace GenPoly 149 166
Note:
See TracChangeset
for help on using the changeset viewer.