[PATCH] [ELF] Allow customization of OutputELFWriter class
Simon Atanasyan
simon at atanasyan.com
Wed Apr 8 06:00:01 PDT 2015
In http://reviews.llvm.org/D8882#153204, @shankar.easwaran wrote:
> You could have a helper class that contains common code that the MIPS executable / dynamic writer can.contain? No?? This was how it used to be right?
This approach is not so bad and used right now. Both `MipsDynamicLibraryWriter` and `MipsExecutableWriter` contains an instance of `MipsELFWriter` which provides helper methods. But I am annoyed a bit that almost all methods of `MipsXXXWriter` classes just call the same methods of `MipsELFWriter` class. Besides that it would be nice to escape code duplication in methods like `MipsXXXWriter::createSymbolTable()`, `MipsXXXWriter::createDynamicTable()` etc. But if I pass this code to the `MipsELFWriter` class I in fact increase number of code lines.
By the way, why don't you use a helper class to keep common code used by `HexagonXXXWriter` classes in the single place? As far as I can see such code has been spread among `HexagonLinkingContext.h` and `HexagonTargetHandler.h` since http://reviews.llvm.org/rL233718.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D8882
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list