Changes in src/Common/PassVisitor.h [35df560:af5c204a]
- File:
-
- 1 edited
-
src/Common/PassVisitor.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r35df560 raf5c204a 18 18 // Templated visitor type 19 19 // To use declare a PassVisitor< YOUR VISITOR TYPE > 20 // The visitor type should specify the previsit/postvisit for types that are desired. 20 // The visitor type should specify the previsit/postvisit/premutate/postmutate for types that are desired. 21 // Note: previsit/postvisit/premutate/postmutate must be **public** members 22 // 23 // Several additional features are available through inheritance 24 // | WithTypeSubstitution - provides polymorphic TypeSubstitution * env for the current expression 25 // | WithStmtsToAdd - provides the ability to insert statements before or after the current statement by adding new statements into 26 // stmtsToAddBefore or stmtsToAddAfter respectively. 27 // | WithShortCircuiting - provides the ability to skip visiting child nodes; set skip_children to true if pre{visit,mutate} to skip visiting children 28 // | WithScopes - provides the ability to save/restore data like a LIFO stack; to save, call GuardValue with the variable to save, the variable 29 // will automatically be restored to its previous value after the corresponding postvisit/postmutate teminates. 21 30 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 22 31 template< typename pass_type > … … 86 95 virtual void visit( ConstructorExpr * ctorExpr ) override final; 87 96 virtual void visit( CompoundLiteralExpr *compLitExpr ) override final; 88 virtual void visit( UntypedValofExpr *valofExpr ) override final;89 97 virtual void visit( RangeExpr *rangeExpr ) override final; 90 98 virtual void visit( UntypedTupleExpr *tupleExpr ) override final; … … 172 180 virtual Expression* mutate( ConstructorExpr *ctorExpr ) override final; 173 181 virtual Expression* mutate( CompoundLiteralExpr *compLitExpr ) override final; 174 virtual Expression* mutate( UntypedValofExpr *valofExpr ) override final;175 182 virtual Expression* mutate( RangeExpr *rangeExpr ) override final; 176 183 virtual Expression* mutate( UntypedTupleExpr *tupleExpr ) override final; … … 231 238 std::list< Statement* > * get_beforeStmts() { return stmtsToAddBefore_impl( pass, 0); } 232 239 std::list< Statement* > * get_afterStmts () { return stmtsToAddAfter_impl ( pass, 0); } 233 std::list< Declaration* > * get_beforeDecls() { return declsToAddBefore_impl( pass, 0); }234 std::list< Declaration* > * get_afterDecls () { return declsToAddAfter_impl ( pass, 0); }235 240 bool visit_children() { bool* skip = skip_children_impl(pass, 0); return ! (skip && *skip); } 236 241 void reset_visit() { bool* skip = skip_children_impl(pass, 0); if(skip) *skip = false; }
Note:
See TracChangeset
for help on using the changeset viewer.