- Timestamp:
- Apr 12, 2024, 4:40:06 PM (9 months ago)
- Branches:
- master
- Children:
- b1b3df5, dc58e5d
- Parents:
- 90320ac
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
r90320ac r7a36848 406 406 template< typename core_t > 407 407 inline void ast::accept_all( ast::TranslationUnit & unit, ast::Pass< core_t > & visitor ) { 408 if ( auto ptr = __pass::translation _unit::get_cptr( visitor.core, 0 ) ) {408 if ( auto ptr = __pass::translationUnit( visitor.core, 0 ) ) { 409 409 ValueGuard<const TranslationUnit *> guard( *ptr ); 410 410 *ptr = &unit; -
src/AST/Pass.proto.hpp
r90320ac r7a36848 257 257 } else { 258 258 node = core.previsit( node ); 259 assertf( node, "Previsit must not return NULL");259 assertf( node, "Previsit must not return nullptr." ); 260 260 } 261 261 } … … 310 310 FIELD_PTR( at_cleanup, __pass::at_cleanup_t ) 311 311 FIELD_PTR( visitor, ast::Pass<core_t> * const ) 312 FIELD_PTR( translationUnit, const TranslationUnit * ) 312 313 313 314 // Remove the macro to make sure we don't clash … … 506 507 } // namespace forall 507 508 508 // For passes that need access to the global context. Searches `translationUnit`509 namespace translation_unit {510 template<typename core_t>511 static inline auto get_cptr( core_t & core, int )512 -> decltype( &core.translationUnit ) {513 return &core.translationUnit;514 }515 516 template<typename core_t>517 static inline const TranslationUnit ** get_cptr( core_t &, long ) {518 return nullptr;519 }520 }521 522 509 // For passes, usually utility passes, that have a result. 523 510 namespace result {
Note: See TracChangeset
for help on using the changeset viewer.