<div dir="ltr"><div>I've not worked directly with RecurisiveASTVisitor, but in my own compiler, I have my own ASTVisitor class, and the way I pass "extra information" is to add it to the class that is doing the visiting. In the RecursiveASTVisitor, that would mean adding it to the `Derived` class that is the template parameter. You then call `getDerived()` to get the derived class and dig out your extra argument that way. Would that work for your case?<br><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 27 April 2015 at 07:04, Saswat Padhi <span dir="ltr"><<a href="mailto:padhi@cs.ucla.edu" target="_blank">padhi@cs.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
I am new to Clang and am trying to build a Static Checker for one of my projects. I am currently using a RecursiveASTVisitor to walk through the AST. But I also need to pass some state to the Traverse* functions, while walking through the AST. For example, when I call TraverseStmt recursively, I need to pass some extra arguments, but the Traverse* functions only accept single arguments. Is there any way I could achieve this?<br>
<br>
I can keep a local stack within the ASTVisitor, but I was wondering if there would be a cleaner way to do it.<br>
<br>
Thanks,<br>
Saswat<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>