[PATCH] D82549: [AIX][XCOFF] parsing xcoff object file auxiliary header
Digger Lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 22 06:03:41 PDT 2021
DiggerLin marked an inline comment as done.
DiggerLin added inline comments.
================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:54
+ void printAuxiliaryHeader(const XCOFFAuxiliaryHeader32 *AuxHeader);
+ void printAuxiliaryHeader(const XCOFFAuxiliaryHeader64 *AuxHeader);
const XCOFFObjectFile &Obj;
----------------
Esme wrote:
> DiggerLin wrote:
> > Esme wrote:
> > > I noticed that the the two functions are very similar, can we make these common to avoid code duplication? As far as I know, almost all members are the same for 32-bit and 64-bit except for `"Additional flags 64-bit XCOFF", XCOFF64Flag`.
> > > I.e. use `template <typename AuxT> void printAuxiliaryHeader(AuxT *AuxHeader);` to replace them.
> > I have think it over before, But I do not think it is possible to use a template to do it. because the member (and the order of the members) of XCOFFAuxiliaryHeader64 and XCOFFAuxiliaryHeader32 are different. and we need to print out the info based on the order which defined in the https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__fyovh386shar
> Thanks.
> In fact, I wouldn't require members to be printed strictly in the order of their offsets. But, of course, printing in order also makes sense to me.
thanks
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82549/new/
https://reviews.llvm.org/D82549
More information about the llvm-commits
mailing list