<div dir="ltr">In my experience the cost of traversing parts of the AST that come from a header is negligible. So if you reject matches in the callback for those that come from files you don't want to change that would be the best way to do it. If you're interested in measuring the performance difference you'd have to hack the internal RecursiveASTVisitor the match finding stuff uses and include a file test at various nodes in the tree to prune the whole sub-tree. Unless your translation unit is absolutely massive and most of it comes from files you don't care about I can't see there being much of a difference.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 11, 2013 at 11:50 AM, Kirk Fertitta <span dir="ltr"><<a href="mailto:kirk@pacificmindworks.com" target="_blank">kirk@pacificmindworks.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="EN-US">
<div>
<p class="MsoNormal">Is there a way to run a matcher directly on just the main source file only, as opposed to all of the includes? I know I can discriminate in my callback, but didn’t know if the “penalty” for traversing so much code was negligible or somehow
avoidable.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any advice is much appreciated.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Kirk Fertitta<u></u><u></u></p>
<p class="MsoNormal">Chief Technical Officer<u></u><u></u></p>
<p class="MsoNormal">Pacific MindWorks, Inc.<u></u><u></u></p>
<p class="MsoNormal">ph: <a href="tel:858-207-6198" value="+18582076198" target="_blank">858-207-6198</a><u></u><u></u></p>
<p class="MsoNormal">fax: <a href="tel:858-521-1385" value="+18585211385" target="_blank">858-521-1385</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Edwin V
</div>