This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Use cantFail() for all `Obj->sections()` calls. NFCI.
ClosedPublic

Authored by grimar on Jul 3 2020, 4:46 AM.

Details

Summary

ELFDumper<ELFT>::ELFDumper calls Obj->sections() in its constructor:
https://github.com/llvm/llvm-project/blob/master/llvm/tools/llvm-readobj/ELFDumper.cpp#L2046

this means that all subsequent calls can't fail and can be
wrapped into cantFail in instead of unwrapOrError for simplicity.

Actually we already do it in a few places. In this patch I've fixed all
other places I've found.

Diff Detail

Event Timeline

grimar created this revision.Jul 3 2020, 4:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2020, 4:46 AM
Herald added a subscriber: rupprecht. · View Herald Transcript
This revision is now accepted and ready to land.Jul 3 2020, 5:20 AM
This revision was automatically updated to reflect the committed changes.