Skip to content

Commit

Permalink
[lldb][DebugNames] Only skip processing of DW_AT_declarations for cla…
Browse files Browse the repository at this point in the history
…ss/union types

This is a follow-up of llvm#92328 (comment)

Clang attaches `DW_AT_declaration` to static inline data members
and `dsymutil` indexes these constants. Skipping these caused
the expression evaluator to fail to find such constants when
using DWARFv5.

Fixes `TestConstStaticIntegralMember.py` on DWARFv5.
  • Loading branch information
Michael137 committed Jun 4, 2024
1 parent aad7874 commit ddf2004
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ bool DebugNamesDWARFIndex::ProcessEntry(
return true;
// Clang erroneously emits index entries for declaration DIEs in case when the
// definition is in a type unit (llvm.org/pr77696). Weed those out.
if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
if (die.IsStructUnionOrClass() &&
die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
return true;
return callback(die);
}
Expand Down

0 comments on commit ddf2004

Please sign in to comment.