[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Allow to selectively skip function bodies while parsing.
From:       Richard Smith <richard () metafoo ! co ! uk>
Date:       2012-11-27 4:54:28
Message-ID: CAOfiQqnkYmae1MAQdSZOSzVhTLaEk5bdUdZCWEpF7v_QzgYpFw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Nov 26, 2012 at 4:03 AM, Olivier Goffart <ogoffart@kde.org> wrote:

> Hi,
>
> I would like to upstream the attached patch which allows ASTConsumer to
> select
> which function to skip while parsing.
>
> I have been using it to do a online code browser:  http://code.woboq.org
>
> Most of the time of my tool is spent in parsing.
> And I have to parse the same includes again and again, and some includes
> have
> a lot of inline functions.
> By skipping body in already seen includes, I was able to reduce the parsing
> time by 30%.
>
> This might also be useful for other tools like refactoring or so.
>

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.

[Attachment #5 (text/html)]

On Mon, Nov 26, 2012 at 4:03 AM, Olivier Goffart <span dir="ltr">&lt;<a \
href="mailto:ogoffart@kde.org" target="_blank">ogoffart@kde.org</a>&gt;</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>



_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic