[cfe-dev] indexer plugin

Luke Zarko via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 2 13:19:43 PDT 2015


Indexing a C++ project will produce a lot of data. It's difficult to tell
when you're doing redundant work; for example, if two source files include
the same header, it's not obvious whether the content of the header can be
processed only once. As Manuel indicates, modules should help with this by
limiting preprocessor shenanigans. Even then, you could still be in trouble
if the header contains template definitions, since these are instantiated
on demand (and your source files might make different demands). We're
looking at various ways to deal with this problem for Kythe, where we spend
most of our C++ processing time not in Clang but instead in handling the
raw output from our indexing tool. I think that you'd end up in the same
situation (except maybe for very small codebases, or if your data model
doesn't store much detail)--you might get your index pieces for free, but
the dominant cost of merging them all together will remain.


On Fri, Oct 2, 2015 at 9:02 AM, Manuel Klimek <klimek at google.com> wrote:

> +luke for somebody who knows that area
>
> On Thu, Oct 1, 2015 at 11:44 PM Oberhoff, Daniel via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hello dear clang hackers,
>>
>> I have recently begun using rtags to get some more grip on my code when
>> working it in emacs. It helps me a lot, but it also uses a lot of resources
>> while indexing my codebase.
>
>
> We're working hard towards C++ modules, which will hopefully solve some of
> the resource issues here.
>
>
>> Recently I have been wondering if all that power going into parsing the
>> code can be re-used to actually compile it. I was thinking that one could
>> just tell the compiler to create some kind of index file along with the
>> product as is possible for dependencies already.
>>
>> Is there anything like that? I.e. planned for clang, or as a plugin
>> somewhere? How hard would it be to make what rtags uses into such a plugin?
>>
>> Best
>>
>> Daniel
>>
>> PS: please reply to me in person, as I am not currently subscribing this
>> list.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151002/603a2c45/attachment.html>


More information about the cfe-dev mailing list