Ignore:
Timestamp:
Jun 22, 2017, 1:13:26 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
186b398
Parents:
65dc863
Message:

PassVisitor? now properly copes skip-children

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.proto.h

    r65dc863 rb73bd70  
    11#pragma once
     2
     3template<typename pass_type>
     4class PassVisitor;
    25
    36typedef std::function<void( void * )> cleanup_func_t;
     
    3134
    3235typedef std::function< void( cleanup_func_t, void * ) > at_cleanup_t;
     36
     37class bool_ref {
     38public:
     39        bool_ref() = default;
     40        ~bool_ref() = default;
     41
     42        operator bool() { return *m_ref; }
     43        bool operator=( bool val ) { return *m_ref = val; }
     44
     45private:
     46
     47        template<typename pass>
     48        friend class PassVisitor;
     49
     50        void set( bool & val ) { m_ref = &val; };
     51
     52        bool * m_ref;
     53};
    3354
    3455//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    114135FIELD_PTR( std::list< Declaration* >, declsToAddBefore )
    115136FIELD_PTR( std::list< Declaration* >, declsToAddAfter  )
    116 FIELD_PTR( bool, skip_children )
     137FIELD_PTR( bool_ref, visit_children )
    117138FIELD_PTR( at_cleanup_t, at_cleanup )
     139FIELD_PTR( PassVisitor<pass_type> * const, visitor )
Note: See TracChangeset for help on using the changeset viewer.