This is an archive of the discontinued LLVM Phabricator instance.

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

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

Diff Detail

Event Timeline

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

LGTM

tools/llvm-ar/llvm-ar.cpp
498

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.Oct 17 2019, 12:27 AM
grandinj added inline comments.
docs/CommandGuide/llvm-ar.rst
150

arhive->archive

tools/llvm-ar/llvm-ar.cpp
191

DisplayOffsets -> DisplayMemberOffsets ?

"offsets" is a rather generic thing

MaskRay updated this revision to Diff 225381.Oct 17 2019, 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.Oct 17 2019, 2:30 AM
tools/llvm-ar/llvm-ar.cpp
498

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

outs() << " 0x" << utohexstr(C.getDataOffset(), true);
MaskRay updated this revision to Diff 225388.Oct 17 2019, 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.