Changeset f23de79d for src/AST/Node.hpp


Ignore:
Timestamp:
May 22, 2019, 5:34:17 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0b8bf27
Parents:
5902625 (diff), 722c4831 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.hpp

    r5902625 rf23de79d  
    9494std::ostream& operator<< ( std::ostream& out, const Node * node );
    9595
     96/// Call a visitor on a possibly-null node
     97template<typename node_t>
     98auto maybe_accept( const node_t * n, Visitor & v ) -> decltype( n->accept(v) ) {
     99        return n ? n->accept( v ) : nullptr;
     100}
     101
    96102/// Base class for the smart pointer types
    97103/// should never really be used.
     
    141147        const o_node_t * as() const { return dynamic_cast<const o_node_t *>(node); }
    142148
     149        /// Returns a mutable version of the pointer in this node.
     150        node_t * get_and_mutate();
     151
    143152        /// Sets this pointer to a mutated version of a pointer (possibly) owned elsehere.
    144153        /// Returns a mutable version of the pointer in this node.
Note: See TracChangeset for help on using the changeset viewer.