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
43
43
/// this will visit all the nodes in a default way that should be useful
44
44
/// for a lot of applications.
45
45
/// </summary>
46
- public abstract class AstVisitor : IAstVisitor < bool > , IAstVisited
46
+ public abstract partial class AstVisitor : IAstVisitor < bool > , IAstVisited
47
47
{
48
48
public ISet < object > Visited { get ; private set ; }
49
49
public AstVisitorOptions VisitOptions { get ; private set ; }
@@ -64,6 +64,11 @@ public bool AlreadyVisited(Declaration decl)
64
64
return ! Visited . Add ( decl ) ;
65
65
}
66
66
67
+ public bool AlreadyVisited ( Stmt stmt )
68
+ {
69
+ return ! Visited . Add ( stmt ) ;
70
+ }
71
+
67
72
#region Type Visitors
68
73
69
74
public virtual bool VisitType ( Type type , TypeQualifiers quals )
@@ -632,5 +637,10 @@ public bool VisitNonTypeTemplateParameterDecl(NonTypeTemplateParameter nonTypeTe
632
637
}
633
638
634
639
#endregion
640
+
641
+ public virtual bool VisitStmt ( Stmt stmt )
642
+ {
643
+ return ! AlreadyVisited ( stmt ) ;
644
+ }
635
645
}
636
646
}
You can’t perform that action at this time.
0 commit comments