<br><br><div class="gmail_quote">On Thu, May 24, 2012 at 6:17 PM, 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 class="gmail_quote"><div class="im">On Thu, May 24, 2012 at 5:42 PM, Bill White <span dir="ltr"><<a href="mailto:bill.white@griggsinst.com" target="_blank">bill.white@griggsinst.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm following this discussion closely, as I'm working on a very<br>
similar constellation<br>
of problems. I'm interested in clang_complete and some form of clang indexing,<br>
but for emacs, not for vim. I'm thinking that the indexing tool<br>
should be something<br>
like ctags or gid, but smarter. I'm working on a python tool to<br>
extract build information<br>
from the output of gmake. (FWIW, I think I have management interest<br>
in contributing<br>
my code to clang, or emacs, or whatever my code ends up being useful for.)<br>
<br>
Does anybody know if the uses of the compilation database cares about the<br>
first parameter in the command? What I'm asking is, if I interpose my command,<br>
say mk_compile_db, for a call to g++, and then do gmake --makeall<br>
CC=mk_compile_db...<br>
the compilation command will say that mk_compile_db is the command, not g++.<br>
It turns out that the path to g++ is explicit in our build system, so<br>
I can't just change<br>
the first word to "g++" and give an accurate answer. On the other<br>
hand, maybe it<br>
doesn't matter what the command is. Maybe the libtooling facilities ignore the<br>
first word, or maybe they expect the first word to be elided altogether.<br></blockquote><div><br></div></div><div>Yes, they ignore argv[0].</div><div><br></div><div>Cheers,</div><div>/Manuel</div><div><div class="h5"><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I could investigate the code, but I think I'd rather know what the<br>
intended behavior is.<br>
<div><div><br>
On Thu, May 24, 2012 at 10:11 AM, Arnaud de Grandmaison<br>
<<a href="mailto:arnaud.allarddegrandmaison@parrot.com" target="_blank">arnaud.allarddegrandmaison@parrot.com</a>> wrote:<br>
> On 05/24/2012 02:28 PM, Manuel Klimek wrote:<br>
>> In the end it depends on who's willing to write which solution and<br>
>> propose a patch to clang ;)<br>
> Do not tempt me ;)<br>
><br>
> The use case I have here is that several people are using clang_complete<br>
> + vim, but have to use gcc because their target requires it. We have<br>
> added a cmake target to generate the ".clang_complete" configuration<br>
> file, which provides the options necessary for compiling the source<br>
> files : in essence, that's a compilation-db. On its side,<br>
> clang_complete also provides a script to extract the compilation options<br>
> from the build system.<br>
><br>
> I am interested in working on this compilationdb, as this will clearly<br>
> be a benefit for clang and all derivative projects.<br>
><br>
> Cheers,<br>
><br>
> --<br>
> Arnaud de Grandmaison<br>
> Senior CPU engineer<br>
> Business Unit Digital Tuner<br>
><br>
> Parrot S.A.<br>
> 174, quai de Jemmapes<br>
> 75010 Paris - France<br>
> Phone: <a href="tel:%2B33%201%2048%2003%2084%2059" value="+33148038459" target="_blank">+33 1 48 03 84 59</a><br>
><br>
</div></div><br></blockquote></div></div></div></blockquote><div><br>I would personally favor the use of the Clang flag or an interposition script to write into the compilation database.<br><br>I don't buy the "building with another compiler" issue as even for such codebases, one can easily run clang with -fsyntax-only and discard the output or a specific -fdo-nothing could be added and ignored by the tool.<br>
<br>I see only two issues:<br>- locking, which would reduce performance<br>- distributed builds: when the compiler is invoked on various machines, how do you centralize the generated information ?<br><br>And I don't think that it is worth worrying too much about them. The creation of the compilation database is a one-off operation so performance is not too much of an issue, and people having the resources to set up such distributed builds should have the resources to configure their build to run on a single machine and/or write scripts to create the database by themselves.<br>
<br>-- Matthieu<br></div></div>