Skip to content

Commit 8c2da89

Browse files
authored
[BOLT] Do not emit debug_names entry for DIEs with DW_AT_declaration (#93347)
Previously BOLT was only doing it for DW_TAG_variables. It looks like other type of DIEs can have this. So making it global.
1 parent 56d319e commit 8c2da89

File tree

4 files changed

+1828
-2
lines changed

4 files changed

+1828
-2
lines changed

bolt/lib/Core/DebugNames.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ void DWARF5AcceleratorTable::addUnit(DWARFUnit &Unit,
112112
// Returns true if DW_TAG_variable should be included in .debug-names based on
113113
// section 6.1.1.1 for DWARF5 spec.
114114
static bool shouldIncludeVariable(const DWARFUnit &Unit, const DIE &Die) {
115-
if (Die.findAttribute(dwarf::Attribute::DW_AT_declaration))
116-
return false;
117115
const DIEValue LocAttrInfo =
118116
Die.findAttribute(dwarf::Attribute::DW_AT_location);
119117
if (!LocAttrInfo)
@@ -148,6 +146,8 @@ static bool shouldIncludeVariable(const DWARFUnit &Unit, const DIE &Die) {
148146

149147
bool static canProcess(const DWARFUnit &Unit, const DIE &Die,
150148
std::string &NameToUse, const bool TagsOnly) {
149+
if (Die.findAttribute(dwarf::Attribute::DW_AT_declaration))
150+
return false;
151151
switch (Die.getTag()) {
152152
case dwarf::DW_TAG_base_type:
153153
case dwarf::DW_TAG_class_type:

0 commit comments

Comments
 (0)