[llvm-readef/obj] - Change the design structure of ELF dumper. NFCI.
This is a refactoring for design of stuff in `ELFDumper.cpp`. The current design of ELF dumper is far from ideal. Currently most overridden functions (inherited from `ObjDumper`) in `ELFDumper` just forward to the functions of `ELFDumperStyle` (which can be either `GNUStyle` or `LLVMStyle`). A concrete implementation may be in any of `ELFDumper`/`DumperStyle`/`GNUStyle`/`LLVMStyle`. This patch reorganizes the classes by introducing `GNUStyleELFDumper`/`LLVMStyleELFDumper` which inherit from `ELFDumper`. The implementations are moved: `DumperStyle` -> `ELFDumper` `GNUStyle` -> `GNUStyleELFDumper` `LLVMStyle` -> `LLVMStyleELFDumper` With that we can avoid having a lot of redirection calls and helper methods. The number of code lines changes from 7142 to 6922 (reduced by ~3%) and the code overall looks cleaner. Differential revision: https://reviews.llvm.org/D93900
Loading
Please sign in to comment