File tree Expand file tree Collapse file tree 4 files changed +1631
-12
lines changed Expand file tree Collapse file tree 4 files changed +1631
-12
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public class AstVisitorOptions
4343 /// this will visit all the nodes in a default way that should be useful
4444 /// for a lot of applications.
4545 /// </summary>
46- public abstract class AstVisitor : IAstVisitor < bool > , IAstVisited
46+ public abstract partial class AstVisitor : IAstVisitor < bool > , IAstVisited
4747 {
4848 public ISet < object > Visited { get ; private set ; }
4949 public AstVisitorOptions VisitOptions { get ; private set ; }
@@ -64,6 +64,11 @@ public bool AlreadyVisited(Declaration decl)
6464 return ! Visited . Add ( decl ) ;
6565 }
6666
67+ public bool AlreadyVisited ( Stmt stmt )
68+ {
69+ return ! Visited . Add ( stmt ) ;
70+ }
71+
6772 #region Type Visitors
6873
6974 public virtual bool VisitType ( Type type , TypeQualifiers quals )
@@ -632,5 +637,10 @@ public bool VisitNonTypeTemplateParameterDecl(NonTypeTemplateParameter nonTypeTe
632637 }
633638
634639 #endregion
640+
641+ public virtual bool VisitStmt ( Stmt stmt )
642+ {
643+ return ! AlreadyVisited ( stmt ) ;
644+ }
635645 }
636646}
You can’t perform that action at this time.
0 commit comments