Page MenuHomePhabricator

[llvm-ar] Implement the O modifier: display member offsets inside the archive

Authored by MaskRay on Thu, Oct 17, 12:19 AM.

Diff Detail

Event Timeline

MaskRay created this revision.Thu, Oct 17, 12:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Oct 17, 12:19 AM
ruiu accepted this revision.Thu, Oct 17, 12:27 AM


498 ↗(On Diff #225359)

This code surprised me a little bit, although it is correct. I'd use utohexstr and operator<< instead of raw_ostream::write_hex.

This revision is now accepted and ready to land.Thu, Oct 17, 12:27 AM
grandinj added inline comments.
150 ↗(On Diff #225359)


195 ↗(On Diff #225359)

DisplayOffsets -> DisplayMemberOffsets ?

"offsets" is a rather generic thing

MaskRay updated this revision to Diff 225381.Thu, Oct 17, 2:24 AM
MaskRay marked 3 inline comments as done.

Address review comments

  1. (outs() << " 0x").write_hex(C.getDataOffset());


outs() << (" 0x" + utohexstr(C.getDataOffset(), true));
  1. DisplayOffsets -> DisplayMemberOffsets
ruiu added inline comments.Thu, Oct 17, 2:30 AM
498 ↗(On Diff #225381)

The following style is more common. Doesn't this work?

outs() << " 0x" << utohexstr(C.getDataOffset(), true);
MaskRay updated this revision to Diff 225388.Thu, Oct 17, 3:29 AM
MaskRay marked an inline comment as done.

Use outs() << " 0x" << utohexstr(C.getDataOffset(), true);

This revision was automatically updated to reflect the committed changes.