[PATCH] D80629: [yaml2obj] - Allocate the file space for SHT_NOBITS sections in some cases.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 04:18:36 PDT 2020


grimar added inline comments.


================
Comment at: llvm/lib/ObjectYAML/ELFEmitter.cpp:872
+  for (const ELFYAML::ProgramHeader &PH : Phdrs)
+    for (ELFYAML::Chunk *C : getChunksAfter(PH, S.Name))
+      if (isa<ELFYAML::Fill>(C) ||
----------------
MaskRay wrote:
> Inlining getChunksAfter can avoid the cost constructing a vector.
I think the cost was very low: there is no much output sections usually, and the case when there are non-nobits sections after a nobit section is also probably rare. But it made the final code to be much shorter.


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

https://reviews.llvm.org/D80629





More information about the llvm-commits mailing list