This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] - Split sections dumping to a new ELFDumper<ELFT>::dumpSections() method.
ClosedPublic

Authored by grimar on Feb 26 2020, 6:12 AM.

Details

Summary

ELFDumper<ELFT>::dump() is too large and deserves splitting.

It is used by https://reviews.llvm.org/D75342

Diff Detail

Event Timeline

grimar created this revision.Feb 26 2020, 6:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2020, 6:12 AM

(This helps to simplify another patch I am working on).

This change is fine, though I want to see materialized advantage before accepting it.. (On its own, it increases complexity.)

On its own, it increases complexity.

By splitting 234 lines method into two I guess .. :)

grimar updated this revision to Diff 247227.Feb 28 2020, 4:45 AM
grimar edited the summary of this revision. (Show Details)
  • Rebase.
jhenderson accepted this revision.Mar 2 2020, 1:25 AM

Personally, I prefer lots of smaller functions, even if they are just chaining into one another, so LGTM (with nit). Might want to let @MaskRay have more time to respond though.

llvm/tools/obj2yaml/elf2yaml.cpp
232

I feel like this is probably a violation of our policy on auto as it's not clear from the line of code what type ChunksOrErr is.

This revision is now accepted and ready to land.Mar 2 2020, 1:25 AM
MaskRay accepted this revision.Mar 2 2020, 9:18 AM
MaskRay added inline comments.
llvm/tools/obj2yaml/elf2yaml.cpp
232

Expand to Expected<std::vector<std::unique_ptr<ELFYAML::Chunk>>>

It should fit on one line.

This revision was automatically updated to reflect the committed changes.