[llvm] Omit member size from DWARF when desired (PR #161423)

Tom Tromey via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 08:52:33 PDT 2025


================
@@ -1889,7 +1889,10 @@ DIE &DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) {
     bool IsBitfield = DT->isBitField();
 
     // Handle the size.
-    if (auto *Var = dyn_cast_or_null<DIVariable>(DT->getRawSizeInBits())) {
+    if (DT->getRawSizeInBits() == nullptr) {
+      // No size, just ignore.
+    } else if (auto *Var =
+                   dyn_cast_or_null<DIVariable>(DT->getRawSizeInBits())) {
----------------
tromey wrote:

Makes sense, I made this change.  Thanks.

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


More information about the llvm-commits mailing list