[PATCH] D60297: [COFF] Pack Name in Symbol as is done in ELF

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 18:06:32 PDT 2019


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


================
Comment at: lld/COFF/Symbols.h:111
+  // Symbol name length. Assume symbol lengths fit in a 32-bit integer.
+  unsigned NameLen;
+
----------------
aganea wrote:
> ruiu wrote:
> > ruiu wrote:
> > > I'd use uint32_t to match the comment.
> > We have the same hack for ELF, and we name these variables NameSize and NameData.
> You could save more by packing this with the bitfield above. ‘SymbolKind’ doesn’t need more than 4 bits, and that would free 21 bits for ‘NameLen’. In practical terms, do we really expect symbol lengths > 2^21 chars? Worst case, there could be a slower/higher mem. codepath for off-the-limits case?
Forget what I said, it’ll be aligned on 64-bits because of the pointer that follows.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60297





More information about the llvm-commits mailing list