On Mon, Nov 26, 2012 at 4:03 AM, Olivier Goffart <span dir="ltr"><<a href="mailto:ogoffart@kde.org" target="_blank">ogoffart@kde.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I would like to upstream the attached patch which allows ASTConsumer to select<br>
which function to skip while parsing.<br>
<br>
I have been using it to do a online code browser:  <a href="http://code.woboq.org" target="_blank">http://code.woboq.org</a><br>
<br>
Most of the time of my tool is spent in parsing.<br>
And I have to parse the same includes again and again, and some includes have<br>
a lot of inline functions.<br>
By skipping body in already seen includes, I was able to reduce the parsing<br>
time by 30%.<br>
<br>
This might also be useful for other tools like refactoring or so.<br></blockquote><div><br></div><div>Thanks, the patch looks good. Please add a test; unittests/Tooling/ToolingTest.cpp would be a reasonable fit. You could test this by using a test case containing a function with an error in its body, and ensure that your hook allows you to control when the parser hits the error.</div>
</div>