[PATCH] D91018: [ELF] Make InputSection smaller
Xun Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 17:21:11 PST 2020
lxfind added inline comments.
================
Comment at: lld/ELF/InputSection.h:393
+static_assert(sizeof(InputSection) <= 184, "InputSection is too big");
+
----------------
Curious, what's the purpose of static_assert like this? Will the program behave incorrectly if the size of InputSection is larger than 184?
Asking because with this assertion whoever adding or removing fields from this class or the base class will need to remember updating this static_assert accordingly, which I am not sure is scalable. That doesn't seem to serve the typical purpose of static_assert (which should be that the program behavior depends on it to be true) I think?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91018/new/
https://reviews.llvm.org/D91018
More information about the llvm-commits
mailing list