<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 10, 2015, at 1:48 AM, Manuel Klimek <<a href="mailto:klimek@google.com" class="">klimek@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">@@ -179,11 +185,13 @@ public:</div><div class="">   /// \param Directory The base directory used in the FixedCompilationDatabase.</div><div class="">   static FixedCompilationDatabase *loadFromCommandLine(int &Argc,</div><div class="">                                                        const char *const *Argv,</div><div class="">-                                                       Twine Directory = ".");</div><div class="">+                                                       Twine Directory = ".",</div><div class="">+                                                       Twine File = Twine());</div><div class=""> </div><div class="">A fixed compilation database returns the same command lines for all files, thus having a file in the function seems strange.</div></div></div></blockquote><div><br class=""></div><div>Ah ok, thanks for clarifying.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">What exactly is the use case? So far, the compilation database has been designed for 2 use cases:</div><div class="">1. for a file, get the compile commands; the user already knows the file, no need to get the file</div><div class="">2. get all compile commands; for that, we have the getAllFiles() method, so a user can get all known files (for compilation databases that support that), and then get the compile command line.</div></div></div></blockquote><div><br class=""></div><div>It’s #2, I want to get all compile commands. But it seems really strange to me that the ‘file’ starts as a property of the compile command in the json file but then it gets dropped and I need to do work to re-associate the files with the compile commands again.</div><div>I need to get a list of all the files and then for each one do a lookup to get the associated commands. I then have to maintain this association myself, passing a command along with its file separately or the structure that keeps track of the association.</div><div><br class=""></div><div>It seems simpler to me to include the file that was associated with the command (if the compilation database supports that) along with the command, is there a downside I’m missing ?</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Thoughts?</div><div class="">/Manuel</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Sep 9, 2015 at 9:36 PM Argyrios Kyrtzidis <<a href="mailto:kyrtzidis@apple.com" class="">kyrtzidis@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
<br class="">
The attached patch exposes the ‘file’ entry in a compilation database command, via the CompileCommand structure.<br class="">
<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>