<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 12 (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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 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;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;}
@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";color:#1F497D">Chandler, the motivation for the renaming was as follows:<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="MsoPlainText"><span lang="EN-US">-----Original Message-----<br>
From: Duncan P. N. Exon Smith [mailto:dexonsmith@apple.com] <br>
Sent: 16 April 2014 20:10<br>
To: Artyom Skrobov<br>
Cc: llvm-commits<br>
Subject: Re: [PATCH] Some code improvements (no functional change)</span><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On 2014-Apr-16, at 11:30, Artyom Skrobov <<a href="mailto:Artyom.Skrobov@arm.com"><span style="color:windowtext;text-decoration:none">Artyom.Skrobov@arm.com</span></a>> wrote:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">> Hello,<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> I suggest these three very simple improvements to LLVM source:<o:p></o:p></p>
<p class="MsoPlainText">> <o:p></o:p></p>
<p class="MsoPlainText">> 1) Extracting the definition of SwapValue(), copypasted between lib/Object/MachOObjectFile.cpp and lib/Object/MachOUniversal.cpp, into include/llvm/Support/SwapByteOrder.h<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">This is fine in principal, but I'm not sure I like the name. When the<o:p></o:p></p>
<p class="MsoPlainText">function is local to a file, SwapValue() is clear enough, but once it's<o:p></o:p></p>
<p class="MsoPlainText">API: how do the names SwapValue() and SwapByteOrder() match up<o:p></o:p></p>
<p class="MsoPlainText">together? Why does the former swap the argument (taken by reference)<o:p></o:p></p>
<p class="MsoPlainText">and the latter return a swapped copy of the argument (taken by value)?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I.e., you might be able to convince me with a better name. But it's a<o:p></o:p></p>
<p class="MsoPlainText">oneliner function with only two users, so the name had better be pretty<o:p></o:p></p>
<p class="MsoPlainText">good.<o:p></o:p></p>
<p class="MsoPlainText"><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"><o:p> </o:p></span></p>
<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""> Chandler Carruth [mailto:chandlerc@google.com]
<br>
<b>Sent:</b> 12 June 2014 16:43<br>
<b>To:</b> Duncan P. N. Exon Smith<br>
<b>Cc:</b> Artyom Skrobov; llvm-commits<br>
<b>Subject:</b> Re: [PATCH] Some code improvements (no functional change)<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I'm lacking context sadly. =/<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Jun 12, 2014 at 4:35 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">> On 2014 May 29, at 03:41, Artyom Skrobov <<a href="mailto:Artyom.Skrobov@arm.com">Artyom.Skrobov@arm.com</a>> wrote:<br>
><br>
> I'd like to ask your opinion on naming the byte-swapping<br>
> functions swapByteOrder for the in-place variants, and getBytesSwapped for<br>
> the by-value/return variants; what do you think?<br>
> In addition to adhering to the lowercase-initial convention advised in the<br>
> Coding Standards, I believe this would also reflect more clearly what the<br>
> functions are doing, than their current names of SwapValue and<br>
> SwapByteOrder.<br>
<br>
Generally we don't change the names of old functions that don't match the<br>
current style guidelines (there's *a lot* of code that predates the style<br>
guidelines, and this would cause a lot of churn).<br>
<br>
Nevertheless, it'd be nice to have in-place variants. I think something<br>
like `SwapByteOrderInPlace()` or `ReplaceByteOrder()` might work with the<br>
naming scheme in the file and minimize code churn.<br>
<br>
+echristo,rafael,bogner<br>
<br>
Anyone else have an opinion on this? Personally, I prefer Artyom's<br>
proposal (renaming `SwapByteOrder`).<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<br>
<font face="Arial" color="Black" size="2">-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents
to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
<br>
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590<br>
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782<br>
</font>
</body>
</html>