Changeset b2a11ba
- Timestamp:
- Sep 18, 2020, 6:12:31 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:
- 0519e34
- Parents:
- 57e0289
- Location:
- src/AST
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r57e0289 rb2a11ba 50 50 // | PureVisitor - makes the visitor pure, it never modifies nodes in place and always 51 51 // clones nodes it needs to make changes to 52 // | With TypeSubstitution - provides polymorphic const TypeSubstitution * envfor the52 // | WithConstTypeSubstitution - provides polymorphic const TypeSubstitution * typeSubs for the 53 53 // current expression 54 54 // | WithStmtsToAdd - provides the ability to insert statements before or after the current … … 294 294 //------------------------------------------------------------------------------------------------- 295 295 296 /// Keep track of the polymorphic const TypeSubstitution * env for the current expression297 298 296 /// If used the visitor will always clone nodes. 299 297 struct PureVisitor {}; 300 298 299 /// Keep track of the polymorphic const TypeSubstitution * typeSubs for the current expression. 301 300 struct WithConstTypeSubstitution { 302 const TypeSubstitution * env= nullptr;301 const TypeSubstitution * typeSubs = nullptr; 303 302 }; 304 303 -
src/AST/Pass.impl.hpp
r57e0289 rb2a11ba 154 154 __pedantic_pass_assert( expr ); 155 155 156 const ast::TypeSubstitution ** env_ptr = __pass::env( core, 0);157 if ( env_ptr && expr->env ) {158 * env_ptr = expr->env;156 const ast::TypeSubstitution ** typeSubs_ptr = __pass::typeSubs( core, 0 ); 157 if ( typeSubs_ptr && expr->env ) { 158 *typeSubs_ptr = expr->env; 159 159 } 160 160 … … 177 177 178 178 // These may be modified by subnode but most be restored once we exit this statemnet. 179 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass:: env( core, 0) );179 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass::typeSubs( core, 0 ) ); 180 180 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 181 181 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); … … 1488 1488 1489 1489 // These may be modified by subnode but most be restored once we exit this statemnet. 1490 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass:: env( core, 0) );1490 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::typeSubs( core, 0 ) ); 1491 1491 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 1492 1492 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); -
src/AST/Pass.proto.hpp
r57e0289 rb2a11ba 236 236 237 237 // List of fields and their expected types 238 FIELD_PTR( env, const ast::TypeSubstitution * )238 FIELD_PTR( typeSubs, const ast::TypeSubstitution * ) 239 239 FIELD_PTR( stmtsToAddBefore, std::list< ast::ptr< ast::Stmt > > ) 240 240 FIELD_PTR( stmtsToAddAfter , std::list< ast::ptr< ast::Stmt > > )
Note: See TracChangeset
for help on using the changeset viewer.