[PATCH] D57447: [llvm-readobj] - Simplify the code.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 30 05:35:23 PST 2019
jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.
Two nits. Otherwise LGTM.
================
Comment at: tools/llvm-readobj/ELFDumper.cpp:387
- Field(StringRef S, unsigned Col) : Str(S), Column(Col) {}
- Field(unsigned Col) : Str(""), Column(Col) {}
+ Field(std::string S, unsigned Col) : Str(S), Column(Col) {}
+ Field(unsigned Col) : Column(Col) {}
----------------
Could this still take a `StringRef`?
================
Comment at: tools/llvm-readobj/ELFDumper.cpp:2962
Fields[1].Str = unwrapOrError(Obj->getSectionName(&Sec));
- Type = getSectionTypeString(Obj->getHeader()->e_machine, Sec.sh_type);
- Fields[2].Str = Type;
- Address = to_string(format_hex_no_prefix(Sec.sh_addr, Width));
- Fields[3].Str = Address;
- Offset = to_string(format_hex_no_prefix(Sec.sh_offset, 6));
- Fields[4].Str = Offset;
- Size = to_string(format_hex_no_prefix(Sec.sh_size, 6));
- Fields[5].Str = Size;
- EntrySize = to_string(format_hex_no_prefix(Sec.sh_entsize, 2));
- Fields[6].Str = EntrySize;
- Flags = getGNUFlags(Sec.sh_flags);
- Fields[7].Str = Flags;
- Link = to_string(Sec.sh_link);
- Fields[8].Str = Link;
- Info = to_string(Sec.sh_info);
- Fields[9].Str = Info;
- Alignment = to_string(Sec.sh_addralign);
- Fields[10].Str = Alignment;
+ Fields[2].Str = getSectionTypeString(Obj->getHeader()->e_machine, Sec.sh_type);
+ Fields[3].Str =
----------------
clang-format?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57447/new/
https://reviews.llvm.org/D57447
More information about the llvm-commits
mailing list