[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
Mon Aug 14 09:40:38 PDT 2023
DiggerLin added inline comments.
================
Comment at: llvm/lib/Object/ArchiveWriter.cpp:1173
for (const MemberData &M : Data) {
+ for (uint64_t i = 0; i < M.PreHeadPadSize; i++)
+ Out << '\0';
----------------
jhenderson wrote:
> It may be slightly more efficient to do something like:
> ```
> OS << std::string(M.PreHeadPadSize, '\0');
> ```
> It's certainly a little more elegant. Alternatively, you could use `std::fill_n`. There are good explanations of both these at https://stackoverflow.com/a/11421689.
we write M.PreHeadPadSize of '\0' , using std::string(M.PreHeadPadSize, '\0') , the string is a empty string , the `OS << std::string(M.PreHeadPadSize, '\0') ` do not output M.PreHeadPadSize of '\0'
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