This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] - Cleanup error reporting (remove Error.cpp/.h files)
ClosedPublic

Authored by grimar on Aug 25 2020, 6:13 AM.

Details

Summary

This removes Error.cpp/.h files from obj2yaml.
These files are not needed because we are
using Errors instead of error codes widely and do
not need a logic related to obj2yaml specific
error codes anymore.

I had to adjust just a few lines of tool's code
to remove remaining dependencies.

Diff Detail

Event Timeline

grimar created this revision.Aug 25 2020, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2020, 6:13 AM
Herald added a subscriber: mgorny. · View Herald Transcript
grimar requested review of this revision.Aug 25 2020, 6:13 AM
Higuoxing accepted this revision.Aug 25 2020, 6:41 AM
Higuoxing added a subscriber: Higuoxing.

Great, LGTM!

llvm/tools/obj2yaml/macho2yaml.cpp
648

I think it should be Mach-O?

This revision is now accepted and ready to land.Aug 25 2020, 6:41 AM
grimar added inline comments.Aug 25 2020, 6:53 AM
llvm/tools/obj2yaml/macho2yaml.cpp
648

I am not sure honestly. For example, llvm-readobj options has MachO:

cl::opt<bool>
MachOSegment("macho-segment",
                cl::desc("Display MachO Segment command"));

// --macho-version-min
cl::opt<bool>
MachOVersionMin("macho-version-min",
                cl::desc("Display MachO version min command"));

// --macho-dysymtab
cl::opt<bool>
MachODysymtab("macho-dysymtab",
                cl::desc("Display MachO Dysymtab command"));
jhenderson accepted this revision.Aug 25 2020, 6:58 AM

LGTM, with @Higuoxing's nit.

llvm/tools/obj2yaml/macho2yaml.cpp
648

I agree with @Higuoxing - the first half-dozen search results for "MachO" actually use "Mach-O". I didn't look further. I think "Mach-O" is the canonical file format name.