<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 21, 2013 at 8:48 AM, Thompson, John <span dir="ltr"><<a href="mailto:John_Thompson@playstation.sony.com" target="_blank">John_Thompson@playstation.sony.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Sean,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(Sorry for the delay in getting back to you, I had a fire to put out elsewhere.)<u></u><u></u></span></p>
<div class="im">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal">>Is there no better way to do this? I think libOption should expose the info you need.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This would seem to have a prerequisite that ClangTooling have a OptTable somewhere, but there doesn’t seem to be a connection.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Now let’s suppose I get past that hurdle, either by creating one myself and somehow coercing it to parse the arguments given to ArgumentsAdjuster, how do I
use libOption to walk the arguments and figure out which command-line argument is the source file?</span></p></div></div></blockquote><div><br></div><div>Maybe look at how the clang driver/frontend does it?</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ideally, tooling should have a mechanism to tell me what the source file or files are for each command line in the compilation database. I had a much simpler
version, but it required I modify ArgumentsAdjuster to be given the source file, which the caller had handy, but I couldn’t get that change through.</span></p></div></div></blockquote><div><br></div><div>The JSON compilation databases have a "file" key which contains just the filename. Maybe that could help?</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Could someone associated with tooling lend a hand and tell me how to get the input file from the command lines in the compilation database?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Otherwise, let’s live with the less-than-perfect solution so I can go on to more important things.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thanks.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-John<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Sean Silva [mailto:<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>]
<br>
<b>Sent:</b> Friday, August 16, 2013 10:59 PM<br>
<b>To:</b> Thompson, John<br>
<b>Cc:</b> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<b>Subject:</b> Re: [PATCH] Header dependencies support for modularize<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">+// The most common (but not all) options to modularize that take<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+// an argument in the following slot.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+// Note: This needs to be kept in sync with new or removed Clang arguments.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+// But hopefully modularize users won't need too many of these<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+// kinds of arguments.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">+const char *AddDependenciesAdjuster::OptionsWithArgument[] = {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is there no better way to do this? I think libOption should expose the info you need.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">-- Sean Silva<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Aug 16, 2013 at 8:42 AM, Thompson, John <<a href="mailto:John_Thompson@playstation.sony.com" target="_blank">John_Thompson@playstation.sony.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">A quick review anyone?<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Thanks.<br>
<br>
-John<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:cfe-commits-bounces@cs.uiuc.edu" target="_blank">cfe-commits-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-commits-bounces@cs.uiuc.edu" target="_blank">cfe-commits-bounces@cs.uiuc.edu</a>] On Behalf Of John Thompson<br>
Sent: Tuesday, August 13, 2013 11:11 AM<br>
To: <a href="mailto:john.thompson.jtsoftware@gmail.com" target="_blank">john.thompson.jtsoftware@gmail.com</a><br>
Cc: <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
Subject: [PATCH] Header dependencies support for modularize<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">In using modularize to check a large group of platform headers for modules-readiness, I found that a few headers had dependencies, such that they required other headers to be included first to avoid compile
errors on missing definitions.<br>
<br>
This patch adds support to modularize to allow specifying depended-on headers in the header file list input to modularize, i.e.<br>
<br>
header.h: dependency1.h dependency2.h<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1383" target="_blank">http://llvm-reviews.chandlerc.com/D1383</a><br>
<br>
Files:<br>
test/modularize/NoProblemsDependencies.modularize<br>
test/modularize/Inputs/SomeOtherTypes.h<br>
test/modularize/Inputs/IsDependent.h<br>
modularize/Modularize.cpp<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">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><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div></div>