[PATCH] D93900: [llvm-readef/obj] - Change the design structure of ELF dumper. NFCI.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 29 16:04:00 PST 2020


MaskRay added a comment.

> Currently we have the ELFDumper class that redirects most of calls to ELFDumperStyle, which can be either GNUStyle or LLVMStyle. Both styles are inhireted from the DumpStyle base class. So we have 4 classes and style classes often have to call methods from the base class (this->dumper()->...). It is not a convenient way.

inhireted -> inherited

"What are the 4 classes and style classes?" needs to be clarified.

I'd rephrase what this patch does:

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

-----

This refactoring looks good to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93900/new/

https://reviews.llvm.org/D93900



More information about the llvm-commits mailing list