<div dir="ltr"><div>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.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 9:02 AM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">+luke for somebody who knows that area<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 1, 2015 at 11:44 PM Oberhoff, Daniel via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello dear clang hackers,<br>
<br>
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.</blockquote><div><br></div><div>We're working hard towards C++ modules, which will hopefully solve some of the resource issues here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> 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.<br>
<br>
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?<br>
<br>
Best<br>
<br>
Daniel<br>
<br>
PS: please reply to me in person, as I am not currently subscribing this list.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>
</blockquote></div><br></div>