Changeset 4c868cb2
- Timestamp:
- Sep 14, 2020, 1:36:21 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:
- 7a8f62c3
- Parents:
- 9a05b81
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
r9a05b81 r4c868cb2 67 67 } 68 68 69 /// mutate should NEVER create new decl since it risks invalidating weak refs 70 /// called by visit template with correct type information so static type checking should suffice 69 71 template< typename core_t, typename node_t > 70 72 static inline node_t* mutate(const node_t *node) { 71 return std::is_base_of<PureVisitor, core_t>::value ? ::ast::shallowCopy(node) : ::ast::mutate(node); 73 // force copying non-decl nodes as a pure function 74 return std::is_base_of<PureVisitor, core_t>::value && !std::is_base_of<ast::Decl, node_t>::value 75 ? ::ast::shallowCopy(node) : ::ast::mutate(node); 72 76 } 73 77
Note: See TracChangeset
for help on using the changeset viewer.