<p dir="ltr">Thanks! </p>
<div class="gmail_quote">On Jun 17, 2015 12:11 PM, "Benjamin Kramer" <<a href="mailto:benny.kra@googlemail.com">benny.kra@googlemail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Wed Jun 17 11:02:56 2015<br>
New Revision: 239913<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D239913-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=XVYfdMqFX_VP7klmA-Y4UXfHa0AyDufBPDFNK92qM4E&s=o1b4E71QEggo5xzQVZ7vjjk2_TH7kUYnF9mHvIIF5_k&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=239913&view=rev</a><br>
Log:<br>
[ArchiveWriter] Use EndianStream. No functional change intended.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Object/ArchiveWriter.cpp<br>
<br>
Modified: llvm/trunk/lib/Object/ArchiveWriter.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Object_ArchiveWriter.cpp-3Frev-3D239913-26r1-3D239912-26r2-3D239913-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=XVYfdMqFX_VP7klmA-Y4UXfHa0AyDufBPDFNK92qM4E&s=GJs-8cRqmn_hSdH2MOhCXBL__nyOR1HI686M9vwJI-s&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ArchiveWriter.cpp?rev=239913&r1=239912&r2=239913&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Object/ArchiveWriter.cpp (original)<br>
+++ llvm/trunk/lib/Object/ArchiveWriter.cpp Wed Jun 17 11:02:56 2015<br>
@@ -18,6 +18,7 @@<br>
 #include "llvm/Object/Archive.h"<br>
 #include "llvm/Object/ObjectFile.h"<br>
 #include "llvm/Object/SymbolicFile.h"<br>
+#include "llvm/Support/EndianStream.h"<br>
 #include "llvm/Support/Errc.h"<br>
 #include "llvm/Support/ErrorHandling.h"<br>
 #include "llvm/Support/Format.h"<br>
@@ -83,9 +84,7 @@ static void printWithSpacePadding(raw_fd<br>
   OS << Data;<br>
   unsigned SizeSoFar = OS.tell() - OldPos;<br>
   if (Size > SizeSoFar) {<br>
-    unsigned Remaining = Size - SizeSoFar;<br>
-    for (unsigned I = 0; I < Remaining; ++I)<br>
-      OS << ' ';<br>
+    OS.indent(Size - SizeSoFar);<br>
   } else if (Size < SizeSoFar) {<br>
     assert(MayTruncate && "Data doesn't fit in Size");<br>
     // Some of the data this is used for (like UID) can be larger than the<br>
@@ -94,12 +93,8 @@ static void printWithSpacePadding(raw_fd<br>
   }<br>
 }<br>
<br>
-static void print32BE(raw_fd_ostream &Out, unsigned Val) {<br>
-  // FIXME: Should use Endian.h here.<br>
-  for (int I = 3; I >= 0; --I) {<br>
-    char V = (Val >> (8 * I)) & 0xff;<br>
-    Out << V;<br>
-  }<br>
+static void print32BE(raw_ostream &Out, uint32_t Val) {<br>
+  support::endian::Writer<support::big>(Out).write(Val);<br>
 }<br>
<br>
 static void printRestOfMemberHeader(raw_fd_ostream &Out,<br>
<br>
<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" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>