Changeset cb25fc9
- Timestamp:
- Oct 27, 2020, 3:26:27 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:
- 5d2db68
- Parents:
- 342be43
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r342be43 rcb25fc9 88 88 if(visitor) { 89 89 *const_cast<type **>( visitor ) = this; 90 } 91 92 // After the pass is constructed, check if it wants to track the inFunction field 93 const bool * const * infunc_ptr = __pass::infunc_ptr(core, 0); 94 if(infunc_ptr) { 95 *const_cast<const bool **>( infunc_ptr ) = &this->inFunction; 90 96 } 91 97 } … … 380 386 }; 381 387 388 /// Used to track whether or not we are in a function. 389 class WithIsInFuncion { 390 const bool * const __in_funct_ptr = nullptr; 391 392 template<typename core_t> 393 friend class Pass; 394 public: 395 bool isInFunction() { 396 assert( __in_funct_ptr ); 397 return *__in_funct_ptr; 398 } 399 }; 400 382 401 /// Use when the templated visitor should update the symbol table 383 402 struct WithSymbolTable { -
src/AST/Pass.proto.hpp
r342be43 rcb25fc9 244 244 FIELD_PTR( at_cleanup, __pass::at_cleanup_t ) 245 245 FIELD_PTR( visitor, ast::Pass<core_t> * const ) 246 FIELD_PTR( infunc_ptr, const bool * const ) 246 247 247 248 // Remove the macro to make sure we don't clash
Note: See TracChangeset
for help on using the changeset viewer.