- Timestamp:
- Jan 4, 2023, 10:28:14 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- d99a716
- Parents:
- 331ee52c
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.hpp
r331ee52c r66a89e7 86 86 { 87 87 // After the pass is constructed, check if it wants the have a pointer to the wrapping visitor 88 type * const * visitor = __pass::visitor( core, 0);89 if (visitor) {88 type * const * visitor = __pass::visitor( core, 0 ); 89 if ( visitor ) { 90 90 *const_cast<type **>( visitor ) = this; 91 91 } … … 98 98 99 99 /// If the core defines a result, call it if possible, otherwise return it. 100 inline auto get_result() -> decltype( __pass:: get_result( core, '0' ) ) {101 return __pass:: get_result( core, '0' );100 inline auto get_result() -> decltype( __pass::result::get( core, '0' ) ) { 101 return __pass::result::get( core, '0' ); 102 102 } 103 103 -
src/AST/Pass.proto.hpp
r331ee52c r66a89e7 489 489 template<typename core_t> 490 490 static inline auto replace( core_t &, long, const ast::TypeInstType *& ) {} 491 492 491 } // namespace forall 493 492 … … 506 505 } 507 506 508 template<typename core_t> 509 static inline auto get_result( core_t & core, char ) -> decltype( core.result() ) { 510 return core.result(); 511 } 512 513 template<typename core_t> 514 static inline auto get_result( core_t & core, int ) -> decltype( core.result ) { 515 return core.result; 516 } 517 518 template<typename core_t> 519 static inline void get_result( core_t &, long ) {} 507 // For passes, usually utility passes, that have a result. 508 namespace result { 509 template<typename core_t> 510 static inline auto get( core_t & core, char ) -> decltype( core.result() ) { 511 return core.result(); 512 } 513 514 template<typename core_t> 515 static inline auto get( core_t & core, int ) -> decltype( core.result ) { 516 return core.result; 517 } 518 519 template<typename core_t> 520 static inline void get( core_t &, long ) {} 521 } 520 522 } // namespace __pass 521 523 } // namespace ast
Note: See TracChangeset
for help on using the changeset viewer.