<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">> Seems out of place in a function "getAddDependenciesAdjuster".<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yeah, I should have changed the name. Will do.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal">> Also it seems egregious to change the default language, what's the rationale?<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Because modularize is compiling .h files, the compiler apparently defaults to C parsing for .h files, making modularize users most of the time pass in a ā-x
c++ā option, something you pointed out before, I think. This just flips the logic and forces C users to specify ā-x cā, assuming C++ will be the more common case.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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""> cfe-commits-bounces@cs.uiuc.edu [mailto:cfe-commits-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Sean Silva<br>
<b>Sent:</b> Wednesday, May 06, 2015 12:52 PM<br>
<b>To:</b> John Thompson<br>
<b>Cc:</b> cfe-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [clang-tools-extra] r236625 - Changed option processing to implicitly use -x c++ if no other -x option specified. Added implicit -w option to disable compilation warnings, in particular to avoid warning on pragma once.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Seems out of place in a function "getAddDependenciesAdjuster". Also it seems egregious to change the default language, what's the rationale?<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- Sean Silva<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, May 6, 2015 at 11:43 AM, John Thompson <<a href="mailto:John.Thompson.JTSoftware@gmail.com" target="_blank">John.Thompson.JTSoftware@gmail.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Author: jtsoftware<br>
Date: Wed May 6 13:43:01 2015<br>
New Revision: 236625<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=236625&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=236625&view=rev</a><br>
Log:<br>
Changed option processing to implicitly use -x c++ if no other -x option specified. Added implicit -w option to disable compilation warnings, in particular to avoid warning on pragma once.<br>
<br>
Modified:<br>
clang-tools-extra/trunk/docs/ModularizeUsage.rst<br>
clang-tools-extra/trunk/modularize/Modularize.cpp<br>
<br>
Modified: clang-tools-extra/trunk/docs/ModularizeUsage.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ModularizeUsage.rst?rev=236625&r1=236624&r2=236625&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ModularizeUsage.rst?rev=236625&r1=236624&r2=236625&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/docs/ModularizeUsage.rst (original)<br>
+++ clang-tools-extra/trunk/docs/ModularizeUsage.rst Wed May 6 13:43:01 2015<br>
@@ -37,9 +37,10 @@ directory.<br>
<br>
``<front-end-options>`` is a place-holder for regular Clang<br>
front-end arguments, which must follow the <include-files-list>.<br>
-Note that by default, the underlying Clang front end assumes .h files<br>
-contain C source, so you might need to specify the ``-x c++`` Clang option<br>
-to tell Clang that the header contains C++ definitions.<br>
+Note that by default, modularize assumes .h files<br>
+contain C++ source, so if you are using a different language,<br>
+you might need to use a ``-x`` option to tell Clang that the<br>
+header contains another language, i.e.: ``-x c``<br>
<br>
Note also that because modularize does not use the clang driver,<br>
you will likely need to pass in additional compiler front-end<br>
<br>
Modified: clang-tools-extra/trunk/modularize/Modularize.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=236625&r1=236624&r2=236625&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=236625&r1=236624&r2=236625&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/modularize/Modularize.cpp (original)<br>
+++ clang-tools-extra/trunk/modularize/Modularize.cpp Wed May 6 13:43:01 2015<br>
@@ -73,9 +73,9 @@<br>
// you will likely need to pass in additional compiler front-end<br>
// arguments to match those passed in by default by the driver.<br>
//<br>
-// Note that by default, the underlying Clang front end assumes .h files<br>
-// contain C source. If your .h files in the file list contain C++ source,<br>
-// you should append the following to your command lines: -x c++<br>
+// Note that by default, the modularize assumes .h files contain C++ source.<br>
+// If your .h files in the file list contain another language, you should<br>
+// append an appropriate -x option to your command line, i.e.: -x c<br>
//<br>
// Modularization Issue Checks<br>
//<br>
@@ -331,7 +331,8 @@ static std::string findInputFile(const C<br>
}<br>
<br>
// This arguments adjuster inserts "-include (file)" arguments for header<br>
-// dependencies.<br>
+// dependencies. It also insertts a "-w" option and a "-x c++",<br>
+// if no other "-x" option is present.<br>
static ArgumentsAdjuster<br>
getAddDependenciesAdjuster(DependencyMap &Dependencies) {<br>
return [&Dependencies](const CommandLineArguments &Args) {<br>
@@ -346,6 +347,13 @@ getAddDependenciesAdjuster(DependencyMap<br>
NewArgs.push_back(FileDependents[Index]);<br>
}<br>
}<br>
+ // Ignore warnings. (Insert after "clang_tool" at beginning.)<br>
+ NewArgs.insert(NewArgs.begin() + 1, "-w");<br>
+ // Since we are compiling .h files, assume C++ unless given a -x option.<br>
+ if (std::find(NewArgs.begin(), NewArgs.end(), "-x") == NewArgs.end()) {<br>
+ NewArgs.insert(NewArgs.begin() + 2, "-x");<br>
+ NewArgs.insert(NewArgs.begin() + 3, "c++");<br>
+ }<br>
return NewArgs;<br>
};<br>
}<br>
<br>
<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><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>