Changes in src/AST/Node.cpp [87701b6:10a1225]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Node.cpp
r87701b6 r10a1225 16 16 #include "Node.hpp" 17 17 #include "Fwd.hpp" 18 19 #include "Attribute.hpp" 18 20 #include "Decl.hpp" 19 21 #include "Expr.hpp" 22 #include "Init.hpp" 20 23 #include "Stmt.hpp" 21 24 #include "Type.hpp" 25 #include "TypeSubstitution.hpp" 22 26 23 27 template< typename node_t, enum ast::Node::ref_type ref_t > … … 26 30 template< typename node_t, enum ast::Node::ref_type ref_t > 27 31 void ast::ptr_base<node_t, ref_t>::_dec( const node_t * node ) { node->decrement(ref_t); } 32 33 /// Sets this pointer to a mutated version of a pointer (possibly) owned elsehere. 34 /// Returns a mutable version of the pointer in this node. 35 template< typename node_t, enum ast::Node::ref_type ref_t > 36 node_t * ast::ptr_base<node_t, ref_t>::set_and_mutate( const node_t * n ) { 37 // ensure ownership of `n` by this node to avoid spurious single-owner mutates 38 assign( n ); 39 // get mutable version of `n` 40 auto r = mutate( node ); 41 // re-assign mutable version in case `mutate()` produced a new pointer 42 assign( r ); 43 return r; 44 } 28 45 29 46 template class ast::ptr_base< ast::Node, ast::Node::ref_type::weak >; … … 153 170 template class ast::ptr_base< ast::CompoundLiteralExpr, ast::Node::ref_type::weak >; 154 171 template class ast::ptr_base< ast::CompoundLiteralExpr, ast::Node::ref_type::strong >; 155 template class ast::ptr_base< ast::UntypedValofExpr, ast::Node::ref_type::weak >;156 template class ast::ptr_base< ast::UntypedValofExpr, ast::Node::ref_type::strong >;157 172 template class ast::ptr_base< ast::RangeExpr, ast::Node::ref_type::weak >; 158 173 template class ast::ptr_base< ast::RangeExpr, ast::Node::ref_type::strong >; … … 229 244 template class ast::ptr_base< ast::ConstructorInit, ast::Node::ref_type::weak >; 230 245 template class ast::ptr_base< ast::ConstructorInit, ast::Node::ref_type::strong >; 231 template class ast::ptr_base< ast::Constant, ast::Node::ref_type::weak >;232 template class ast::ptr_base< ast::Constant, ast::Node::ref_type::strong >;233 246 template class ast::ptr_base< ast::Attribute, ast::Node::ref_type::weak >; 234 247 template class ast::ptr_base< ast::Attribute, ast::Node::ref_type::strong >;
Note: See TracChangeset
for help on using the changeset viewer.