- Timestamp:
- Sep 15, 2022, 11:28:46 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 747d0fa, a2fd937
- Parents:
- 25793da
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/AST/Pass.impl.hpp ¶
r25793da r95e5018 26 26 using namespace ast; \ 27 27 /* back-up the last known code location */ \ 28 __attribute__((unused)) auto loc_guard = ast::__pass::make_location_guard( core, node ); \28 __attribute__((unused)) auto loc_guard = ast::__pass::make_location_guard( core, node, 0 ); \ 29 29 /* back-up the visit children */ \ 30 30 __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children(core, 0) ); \ -
TabularUnified src/AST/Pass.proto.hpp ¶
r25793da r95e5018 295 295 FIELD_PTR( at_cleanup, __pass::at_cleanup_t ) 296 296 FIELD_PTR( visitor, ast::Pass<core_t> * const ) 297 FIELD_PTR( location, const CodeLocation * )298 297 299 298 // Remove the macro to make sure we don't clash … … 328 327 329 328 template< typename core_t, typename node_t > 330 static auto make_location_guard(core_t & core, node_t * node) -> ValueGuardPtr<const CodeLocation *> { 331 if constexpr (std::is_base_of<ParseNode, node_t>::value) { 332 const CodeLocation ** p = location(core, 0); 333 if(p) { 334 ValueGuardPtr<const CodeLocation *> g = { p }; 335 *p = &node->location; 336 return g; 337 } 338 } 339 (void)node; 340 return { nullptr }; 329 static auto make_location_guard( core_t & core, node_t * node, int ) 330 -> decltype( node->location, ValueGuardPtr<const CodeLocation *>( &core.location ) ) { 331 ValueGuardPtr<const CodeLocation *> guard( &core.location ); 332 core.location = &node->location; 333 return guard; 334 } 335 336 template< typename core_t, typename node_t > 337 static auto make_location_guard( core_t &, node_t *, long ) -> int { 338 return 0; 341 339 } 342 340
Note: See TracChangeset
for help on using the changeset viewer.