[PATCH] D92218: [llvm-readelf/obj] - Move unique warning handling logic to the `ObjDumper`.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 02:51:46 PST 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, sunfish, sbc100.
Herald added a project: LLVM.
grimar requested review of this revision.
Herald added a subscriber: aheejin.

This moves the `reportUniqueWarning` method to the base class.

My motivation is the following:
I've experimented with replacing `reportWarning` calls with `reportUniqueWarning`
in ELF dumper. I've found that for example for removing them from `DynRegionInfo` helper
class, it is worth to pass a dumper instance to it (to be able to call dumper()->reportUniqueWarning()).
The problem was that `ELFDumper<ELFT>` is a template class. I had to make `DynRegionInfo` to be templated
and do lots of minor changes everywhere what did not look reasonable/nice.

At the same time I guess one day other dumpers like COFF/MachO/Wasm etc might want to
start using `reportUniqueWarning` API too. Then it looks reasonable to move the logic to the
base class.

With that the problem of passing the dumper instance will be gone.


https://reviews.llvm.org/D92218

Files:
  llvm/tools/llvm-readobj/COFFDumper.cpp
  llvm/tools/llvm-readobj/ELFDumper.cpp
  llvm/tools/llvm-readobj/MachODumper.cpp
  llvm/tools/llvm-readobj/ObjDumper.cpp
  llvm/tools/llvm-readobj/ObjDumper.h
  llvm/tools/llvm-readobj/WasmDumper.cpp
  llvm/tools/llvm-readobj/XCOFFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92218.308000.patch
Type: text/x-patch
Size: 6636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201127/dea50527/attachment.bin>


More information about the llvm-commits mailing list