Changeset 361bf01 for src/ResolvExpr/RenameVars.cc
- Timestamp:
- Dec 11, 2020, 11:20:45 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5b9a0ae
- Parents:
- a6e0e4c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/RenameVars.cc
ra6e0e4c r361bf01 93 93 } 94 94 95 template<typename NodeT> 96 const NodeT * openLevel( const NodeT * type ) { 95 const ast::FunctionType * openLevel( const ast::FunctionType * type ) { 97 96 if ( type->forall.empty() ) return type; 98 97 … … 100 99 101 100 // Load new names from this forall clause and perform renaming. 102 NodeT *mutType = ast::mutate( type );101 auto mutType = ast::mutate( type ); 103 102 assert( type == mutType && "mutated type must be unique from ForallSubstitutor" ); 104 103 for ( ast::ptr< ast::TypeDecl > & td : mutType->forall ) { 104 assertf(dynamic_cast<ast::FunctionType *>(mutType), "renaming vars in non-function type"); 105 105 std::ostringstream output; 106 106 output << "_" << resetCount << "_" << level << "_" << td->name; … … 119 119 } 120 120 121 void closeLevel( const ast:: ParameterizedType * type ) {121 void closeLevel( const ast::FunctionType * type ) { 122 122 if ( type->forall.empty() ) return; 123 123 … … 149 149 return renaming.openLevel( type ); 150 150 } 151 152 /* 151 153 const ast::StructInstType * previsit( const ast::StructInstType * type ) { 152 154 return renaming.openLevel( type ); … … 158 160 return renaming.openLevel( type ); 159 161 } 162 */ 163 160 164 const ast::TypeInstType * previsit( const ast::TypeInstType * type ) { 161 return renaming.rename( renaming.openLevel( type ));165 return renaming.rename( type ); 162 166 } 163 void postvisit( const ast:: ParameterizedType * type ) {167 void postvisit( const ast::FunctionType * type ) { 164 168 renaming.closeLevel( type ); 165 169 }
Note: See TracChangeset
for help on using the changeset viewer.