[PATCH] D57447: [llvm-readobj] - Simplify the code.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 04:57:25 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, rupprecht.

We have a `Field` struct which has a `StringRef` member `Str`.

The code needs to create and keep alive the temporarily `std::string` variables because of that.
That is not convenient and makes the code be more complicated than it could be.

I see no reason to keep `Str` be `StringRef` and suggest to make it `std::string`.
This patch does that and also rearranges the code slightly to regroup it in a
more natural way after the change.


https://reviews.llvm.org/D57447

Files:
  tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57447.184277.patch
Type: text/x-patch
Size: 14850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190130/5e7b0224/attachment.bin>


More information about the llvm-commits mailing list