[clang-tools-extra] [clangd] Show alignment for records and fields decls (PR #67213)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 21 08:40:59 PDT 2023


================
@@ -1488,6 +1491,8 @@ markup::Document HoverInfo::present() const {
           llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
     }
   }
+  if (Align)
+    Output.addParagraph().appendText("Align: " + formatSize(*Align));
----------------
sr-tream wrote:

> My preference would be to have alignment on the same line as size

But size may include padding for member fields. How would you like to see it?

Like this?
```
Size 24 bytes (8 bytes align) // for structs/classes
Size 1 byte (+7 bytes padding, 8 bytes align) // for member fields with padding
```

https://github.com/llvm/llvm-project/pull/67213


More information about the cfe-commits mailing list