This is an archive of the discontinued LLVM Phabricator instance.

MC: Change object writers to use endian::Writer. NFCI.
ClosedPublic

Authored by pcc on May 17 2018, 5:00 PM.

Event Timeline

pcc created this revision.May 17 2018, 5:00 PM
JDevlieghere accepted this revision.May 18 2018, 3:22 AM

LGTM

llvm/tools/dsymutil/MachOUtils.cpp
493

Why not use write_zeros here too?

This revision is now accepted and ready to land.May 18 2018, 3:22 AM
pcc added inline comments.May 18 2018, 12:50 PM
llvm/tools/dsymutil/MachOUtils.cpp
493

It seemed a little more straightforward to write the zero directly here.

echristo accepted this revision.May 20 2018, 9:37 PM

LGTM.

llvm/lib/MC/MCLinkerOptimizationHint.cpp
39

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.

llvm/tools/dsymutil/MachOUtils.cpp
493

Agreed. Even more clear that it's just nul termination as well.

pcc added inline comments.May 21 2018, 10:58 AM
llvm/lib/MC/MCLinkerOptimizationHint.cpp
39

Yes, the whole way that LOH directives are handled seems a little odd and it may be better for it to mostly live in the Mach-O object writer. That seemed out of scope for the work that I was doing so I left it for now.

This revision was automatically updated to reflect the committed changes.