Skip to content

Commit 7439524

Browse files
Teemperorjasonmolenda
authored andcommitted
[lldb] Partly revert "Allow range-based for loops over DWARFDIE's children"
As pointed out in D107434 by Walter, D103172 also changed two for loops that were actually not just iterating over some DIEs but also using the iteration variable later on for some other things. This patch reverts the respective faulty parts of D103172. (cherry picked from commit e4977f9)
1 parent 9bffefe commit 7439524

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,7 +3478,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
34783478
UniqueCStringMap<DWARFDIE> dst_name_to_die;
34793479
UniqueCStringMap<DWARFDIE> src_name_to_die_artificial;
34803480
UniqueCStringMap<DWARFDIE> dst_name_to_die_artificial;
3481-
for (DWARFDIE src_die : src_class_die.children()) {
3481+
for (src_die = src_class_die.GetFirstChild(); src_die.IsValid();
3482+
src_die = src_die.GetSibling()) {
34823483
if (src_die.Tag() == DW_TAG_subprogram) {
34833484
// Make sure this is a declaration and not a concrete instance by looking
34843485
// for DW_AT_declaration set to 1. Sometimes concrete function instances
@@ -3496,7 +3497,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
34963497
}
34973498
}
34983499
}
3499-
for (DWARFDIE dst_die : dst_class_die.children()) {
3500+
for (dst_die = dst_class_die.GetFirstChild(); dst_die.IsValid();
3501+
dst_die = dst_die.GetSibling()) {
35003502
if (dst_die.Tag() == DW_TAG_subprogram) {
35013503
// Make sure this is a declaration and not a concrete instance by looking
35023504
// for DW_AT_declaration set to 1. Sometimes concrete function instances

0 commit comments

Comments
 (0)