[PATCH] D47040: MC: Change object writers to use endian::Writer. NFCI.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 20 21:37:32 PDT 2018


echristo accepted this revision.
echristo added a comment.

LGTM.



================
Comment at: llvm/lib/MC/MCLinkerOptimizationHint.cpp:39
                           const MCAsmLayout &Layout) const {
-  raw_ostream &OutStream = ObjWriter.getStream();
+  raw_ostream &OutStream = ObjWriter.W.OS;
   emit_impl(OutStream, ObjWriter, Layout);
----------------
FWIW this change feels a bit awkward. It's fine for now and I don't know if it's changed in a future patch. That said, it can easily be cleaned up later.


================
Comment at: llvm/tools/dsymutil/MachOUtils.cpp:493
     // transferSymbol).
-    Writer.WriteZeros(1);
+    OutFile << '\0';
     std::vector<DwarfStringPoolEntryRef> Strings = NewStrings.getEntries();
----------------
pcc wrote:
> JDevlieghere wrote:
> > Why not use `write_zeros` here too?
> It seemed a little more straightforward to write the zero directly here.
Agreed. Even more clear that it's just nul termination as well.


https://reviews.llvm.org/D47040





More information about the llvm-commits mailing list