[PATCH] D39406: Merge SymbolBody and Symbol into one class, SymbolBody.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 29 14:07:23 PDT 2017


ruiu added a comment.

The size of the symbol remains the same 88 bytes. If we have to pack it better, we can do it by tweaking some members of SymbolBody, but looks like the program isn't very sensitive to the size of Symbol.



================
Comment at: lld/ELF/Symbols.h:54
 
-  Symbol *symbol();
-  const Symbol *symbol() const {
-    return const_cast<SymbolBody *>(this)->symbol();
-  }
+  // Symbol binding. This is on the Symbol to track changes during resolution.
+  // In particular:
----------------
pcc wrote:
> This comment needs to be updated.
Done.


================
Comment at: lld/ELF/Symbols.h:411
-void replaceBody(Symbol *S, InputFile *File, ArgT &&... Arg) {
-  static_assert(sizeof(T) <= sizeof(S->Body), "Body too small");
-  static_assert(alignof(T) <= alignof(decltype(S->Body)),
----------------
pcc wrote:
> Why drop the asserts?
Resurrected.


================
Comment at: lld/ELF/Symbols.h:415
+  alignas(SharedSymbol) char D[sizeof(SharedSymbol)];
+  alignas(LazyArchive) char E[sizeof(LazyArchive)];
+};
----------------
pcc wrote:
> Also want LazyObject here.
Done.


https://reviews.llvm.org/D39406





More information about the llvm-commits mailing list