[cfe-commits] [cfe-dev] Allow to selectively skip function bodies while parsing.

Olivier Goffart ogoffart at kde.org
Tue Nov 27 04:30:04 PST 2012


On Monday 26 November 2012 20:54:28 Richard Smith wrote:
> On Mon, Nov 26, 2012 at 4:03 AM, Olivier Goffart <ogoffart at 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.

Hi,

Same patch with a test.

Regards
-- 
Olivier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-hook-in-the-ASTConsumer-to-be-able-to-skip-fun.patch
Type: text/x-patch
Size: 3090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121127/7cf07681/attachment.bin>


More information about the cfe-commits mailing list