[PATCH] D105045: [lld-macho] Deduplicate CFStrings

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 16:16:36 PDT 2021


gkm added a comment.

LGTM



================
Comment at: lld/MachO/InputFiles.cpp:287
+                segname == segment_names::data)) {
+      uint64_t literalSize = target->wordSize == 8 ? 32 : 16;
+      subsections.push_back({});
----------------



================
Comment at: lld/test/MachO/cfstring-dedup.s:75
+  .quad  l_.str.2
+  .quad  4 ## strlen
+
----------------
Length of UTF-8 "foo" is 3, but length of UTF-16 "foo" (or rather "foo\0") is 4? I do see that `l_.str.2` has an extra 0 terminator. Is that detail relevant? If so, it could use a comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105045



More information about the llvm-commits mailing list