<html><head></head><body data-blackberry-caret-color="#00a8df" style="background-color: rgb(255, 255, 255); line-height: initial;"><div id="BB10_response_div" style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><span style="line-height: initial;">SingleCompilationDatabase is just a quick and safe way to pass compilation args from the parent process to the sub-process. The parent process asks its compilation database for args for a given file. If it's a json database you get exactly what's in the json file. If it's a fixed database you get a bogus "argv0" and the file name tacked on the end. If we were to rely on FixedCompilationDatabase to pass these args to the sub-process we need to strip out the filename and the argv0. The argv0 is straightforward since it's the first item in the vector of command line args. However, finding the filename is trickier. Where it's located depends on the database that provided the args. There's also the possibility the filename isn't in the args on its own or its after another arg like -c in which case we don't want to remove the filename. These problems are all soluble but it would end up duplicating what must happen in the clang driver or clang::tooling somewhere.</span></div><div><br></div><div>We felt the easiest and safest option was to pass the args exactly as the comdb provides them. The new SingleCompilationDatabase takes these args directly and represents them identically as in the parent process.</div>                                                                                                                                     <div id="response_div_spacer" style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br style="display:initial"></div>                                                                                                                                     <div id="_signaturePlaceholder" style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Sent from my BlackBerry 10 smartphone.</div>                                                                                                                                                                                        <table width="100%" style="background-color:white;border-spacing:0px;"> <tbody><tr><td id="_persistentHeaderContainer" colspan="2" style="font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">                                              <div id="_persistentHeader" style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <div><b>From: </b>Manuel Klimek</div><div><b>Sent: </b>Friday, October 11, 2013 12:06 PM</div><div><b>To: </b>reviews+D1877+public+656d0bc9c028c19a@llvm-reviews.chandlerc.com</div><div><b>Cc: </b>Guillaume Papin; cfe-commits@cs.uiuc.edu</div><div><b>Subject: </b>Re: [PATCH] clang-modernize: Add SubprocessCompilationDatabase</div></div></td></tr></tbody></table><div id="_persistentHeaderEnd" style="border-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div id="_originalContent" style=""><div dir="ltr">On Thu, Oct 10, 2013 at 3:34 PM, Edwin Vane <span dir="ltr"><<a href="mailto:edwin.vane@intel.com" target="_blank">edwin.vane@intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  The problem is the FixedCompilationDatabase mangles the arguments you pass. FixedCompilationDatabase as a result has some preconditions: the name of the compiler should not be present nor should be the filename to operate on. Check CompilationDatabase.h for a better description. As stated in the patch summary we need a simpler compilation database that simply accepts a full list of args and then provides those same args back upon request.<br>

<br>
  I'll fix the comment and add a test for -c -c<br></blockquote><div><br></div><div>I still don't understand this explanation. Can you elaborate, why calling "tool -- <command line args>" doesn't work if you want to subprocess.</div>
<div><br></div><div>(I also don't understand yet why you want to subprocess out, but that's a different topic - is it to run them in parallel?)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5"><br>
<a href="http://llvm-reviews.chandlerc.com/D1877" target="_blank">http://llvm-reviews.chandlerc.com/D1877</a><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>
<br><!--end of _originalContent --></div></body></html>