[PATCH] D144872: [AIX] Align the content of an xcoff object file which has auxiliary header in big archive.

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 14:02:20 PST 2023


DiggerLin added inline comments.


================
Comment at: llvm/lib/Object/ArchiveWriter.cpp:445
+// MAX(maximum alignment of .text , maximum alignment of .data).
+static uint32_t getMemberAlignment(const StringRef &ObjStringRef) {
+  LLVMContext Context;
----------------
jhenderson wrote:
> Two nits, and one more significant point.
> 1) No need for `const &` for `StringRef`, which is intended to be copied.
> 2) `ObjStringRef` -> `Obj`.
> 3) This function appears to be reading in the file and parsing it just to get the alignments. However, presumably this isn't the only place where we have the fully parsed object, since at some point you have to know what to write in the object file in the first place, right? Wouldn't it make more sense to identify and record this alignment then?
yes


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144872



More information about the llvm-commits mailing list