[PATCH] D102964: [lld-macho] Implement cstring deduplication

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 19:19:31 PDT 2021


int3 marked an inline comment as done.
int3 added inline comments.


================
Comment at: lld/MachO/InputSection.h:102
+  uint32_t inSecOff;
+  uint32_t hash;
+  uint64_t outSecOff;
----------------
gkm wrote:
> Why are we truncating 64-bit hashes to 32 bits? Because the low-order 32 bits are sufficient, and it's more important that `StringPiece` be 16 bytes vs. 24 bytes?
This was copied from LLD-ELF's implementation, and yeah the motivation is to reduce the memory cost. I'll copy over the comment too...


================
Comment at: lld/MachO/InputSection.h:142
+
+  std::vector<StringPiece> pieces;
 };
----------------
alexshap wrote:
> does it need to be `public` ?
`CStringSection::finalize()` needs it to be public


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102964



More information about the llvm-commits mailing list