[PATCH] D98377: [clangd] Show padding following a field on field hover.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 10 16:48:18 PST 2021


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:105
+         HI.Size = 1;
+         HI.Padding = 15;
+         HI.AccessSpecifier = "public";
----------------
njames93 wrote:
> Does it make any sense to include the padding for union fields?
I think so - it tells you how much room you have to grow/are wasting in particular branches of the union. True, it's easy enough to infer by looking at the union size and the field size. But on the other hand, the *purpose* of a union is to get a compact memory layout, so memory layout information is more likely to be useful.

Maybe we should omit Offset though...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98377



More information about the cfe-commits mailing list