[llvm] Omit member size from DWARF when desired (PR #161423)
Vladislav Dzhidzhoev via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 2 04:36:00 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())) {
----------------
dzhidzhoev wrote:
Should dyn_cast_or_null be replaced with dyn_cast here and in the else-if clause below?
https://github.com/llvm/llvm-project/pull/161423
More information about the llvm-commits
mailing list