Changeset b73bd70 for src/Common/PassVisitor.h
- Timestamp:
- Jun 22, 2017, 1:13:26 PM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r65dc863 rb73bd70 37 37 PassVisitor(Args &&... args) 38 38 : pass( std::forward<Args>( args )... ) 39 {} 39 { 40 typedef PassVisitor<pass_type> this_t; 41 this_t * const * visitor = visitor_impl(pass, 0); 42 if(visitor) { 43 *const_cast<this_t **>( visitor ) = this; 44 } 45 } 40 46 41 47 virtual ~PassVisitor() = default; … … 240 246 std::list< Declaration* > * get_beforeDecls() { return declsToAddBefore_impl( pass, 0); } 241 247 std::list< Declaration* > * get_afterDecls () { return declsToAddAfter_impl ( pass, 0); } 242 bool visit_children() { bool* skip = skip_children_impl(pass, 0); return ! (skip && *skip); } 243 void reset_visit() { bool* skip = skip_children_impl(pass, 0); if(skip) *skip = false; }248 249 void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); } 244 250 245 251 guard_value_impl init_guard() { … … 280 286 std::list< Statement* > stmtsToAddAfter; 281 287 }; 282 283 288 class WithShortCircuiting { 284 289 protected: … … 287 292 288 293 public: 289 bool skip_children;294 bool_ref visit_children; 290 295 }; 291 296 … … 306 311 }; 307 312 313 template<typename pass_type> 314 class WithVisitorRef { 315 protected: 316 WithVisitorRef() = default; 317 ~WithVisitorRef() = default; 318 319 public: 320 PassVisitor<pass_type> * const visitor; 321 }; 308 322 309 323 #include "PassVisitor.impl.h"
Note: See TracChangeset
for help on using the changeset viewer.