<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:0cm;
        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:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Thanks for the recommendations.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The MIPS team itself is unanimously agreed that an initial formatting is worth the cost. I've had an objection from David Chisnall which I'm trying to accommodate by waiting
 for him to upstream the relevant parts of his out-of-tree modifications before going ahead. I haven't had any other objections but I intend to send an email giving three weeks' notice calling for comments/objections in case there are others.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">At the moment, the MIPS backend is generally consistent inside each file but not between them. When I ran clang-format on lib/Target/Mips/*.{cpp,h} in my working copy, the
 diff was 555KB, so I'd say it's generally inconsistent with clang-format.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Daniel Jasper<br>
<b>Sent:</b> 09 January 2014 11:19<br>
<b>To:</b> Manuel Klimek<br>
<b>Cc:</b> Reed Kotler; Tobias Grosser; LLVMdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] running clang format on the Mips target<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I would slightly alter this recommendation depending on whether the codebase is currently in a reasonably consistent state (both internally and wrt. what clang-format would do).<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The basic assumption is that code is easier to read if it is more consistent.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If the code base is currently inconsistently formatted, then a full reformatting might provide benefit. If it is significantly different from clang-format, then an incremental approach has the cost of making the code more inconsistent (at
 least temporarily).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Jan 9, 2014 at 12:03 PM, Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">FYI, our usual recommendation is to use clang-format only on changed code, unless there's strong evidence that the cost of the initial reformatting is basically zero (which usually means a team / community is pretty unanimous about the
 decision).<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Jan 9, 2014 at 11:53 AM, Tobias Grosser <<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Manuel, Daniel,<br>
<br>
I forgot to CC you in this mail. The thread here may be interesting to you, also in the light of the last discussion we had.<span style="color:#888888"><br>
<br>
Tobias</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
On 12/21/2013 12:00 AM, Tobias Grosser wrote:<o:p></o:p></p>
<p class="MsoNormal">On 12/20/2013 11:18 PM, Rafael EspĂ­ndola wrote:<o:p></o:p></p>
<p class="MsoNormal">On 20 December 2013 15:52, reed kotler <<a href="mailto:rkotler@mips.com" target="_blank">rkotler@mips.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">We are considering running clang format on the whole Mips target.<br>
<br>
Is there any rule against this?<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
I don't think there is a rule, but even simpler things like "remove<br>
all trailing spaces" were not common in the past<o:p></o:p></p>
<p class="MsoNormal">Is there any good argument against doing this even if there is no rule<br>
against it?<o:p></o:p></p>
<p class="MsoNormal"><br>
It think the argument was that it makes history harder to follow. A<br>
git blame lands you on the reformatting patch and you have to manually<br>
skip them.<br>
<br>
I don't personally consider that a strong argument and I think polly<br>
did just that (run clang-format on everything), so it might be OK<br>
these days.<o:p></o:p></p>
<p class="MsoNormal"><br>
Unfortunately for Polly it was not as clean as we started using<br>
clang-format early, so we had to format piece by piece the sections that<br>
clang-format could already handle.<br>
<br>
However, we now have an automatic clang-format buildbot so formatting<br>
became (in some way) a 'solved problem'.<br>
<br>
One benefit of fully formatted source code is that there is no need for<br>
any new patches to include 'formatting fixes', which previously<br>
sometimes obfuscated submitted patches and commits. In fact, patch<br>
reviews are now free of formatting discussions. If the patch passes<br>
make polly-check-format, it is ready to be discussed. (If it does not,<br>
make polly-update-format needs to be run). Also, having a single<br>
formatting commit to skip might arguably be easier, than to have a mixed<br>
history of formatting and patches.<br>
<br>
One reason that may hold us back from formatting all LLVM code is the<br>
risk of clang-format changing its formatting behavior. The only thing<br>
worse than formatting all code is formatting all code twice. ;)<br>
<br>
 From my experience with Polly, clang-format's formatting has been<br>
largely stable the last months. Changes in its formatting behavior have<br>
normally been fixed quickly. So it may make sense to format more code.<br>
I would still be afraid of formatting all LLVM, but maybe a backend is<br>
a reasonable sized chunk.<br>
<br>
Maybe Manual and Daniel have some experience in formatting a larger set<br>
of files.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>