Skip to content

Commit e4977f9

Browse files
committed
[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.
1 parent d7b0e55 commit e4977f9

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
@@ -3477,7 +3477,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
34773477
UniqueCStringMap<DWARFDIE> dst_name_to_die;
34783478
UniqueCStringMap<DWARFDIE> src_name_to_die_artificial;
34793479
UniqueCStringMap<DWARFDIE> dst_name_to_die_artificial;
3480-
for (DWARFDIE src_die : src_class_die.children()) {
3480+
for (src_die = src_class_die.GetFirstChild(); src_die.IsValid();
3481+
src_die = src_die.GetSibling()) {
34813482
if (src_die.Tag() == DW_TAG_subprogram) {
34823483
// Make sure this is a declaration and not a concrete instance by looking
34833484
// for DW_AT_declaration set to 1. Sometimes concrete function instances
@@ -3495,7 +3496,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
34953496
}
34963497
}
34973498
}
3498-
for (DWARFDIE dst_die : dst_class_die.children()) {
3499+
for (dst_die = dst_class_die.GetFirstChild(); dst_die.IsValid();
3500+
dst_die = dst_die.GetSibling()) {
34993501
if (dst_die.Tag() == DW_TAG_subprogram) {
35003502
// Make sure this is a declaration and not a concrete instance by looking
35013503
// for DW_AT_declaration set to 1. Sometimes concrete function instances

0 commit comments

Comments
 (0)