[Lldb-commits] [lldb] e4977f9 - [lldb] Partly revert "Allow range-based for loops over DWARFDIE's children"

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 4 02:15:32 PDT 2021


Author: Raphael Isemann
Date: 2021-08-04T11:05:08+02:00
New Revision: e4977f9cb58ff7820d0287ba309490af57787749

URL: https://github.com/llvm/llvm-project/commit/e4977f9cb58ff7820d0287ba309490af57787749
DIFF: https://github.com/llvm/llvm-project/commit/e4977f9cb58ff7820d0287ba309490af57787749.diff

LOG: [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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 46015f7b43b1c..79e6b3f609651 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3477,7 +3477,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
   UniqueCStringMap<DWARFDIE> dst_name_to_die;
   UniqueCStringMap<DWARFDIE> src_name_to_die_artificial;
   UniqueCStringMap<DWARFDIE> dst_name_to_die_artificial;
-  for (DWARFDIE src_die : src_class_die.children()) {
+  for (src_die = src_class_die.GetFirstChild(); src_die.IsValid();
+       src_die = src_die.GetSibling()) {
     if (src_die.Tag() == DW_TAG_subprogram) {
       // Make sure this is a declaration and not a concrete instance by looking
       // for DW_AT_declaration set to 1. Sometimes concrete function instances
@@ -3495,7 +3496,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
       }
     }
   }
-  for (DWARFDIE dst_die : dst_class_die.children()) {
+  for (dst_die = dst_class_die.GetFirstChild(); dst_die.IsValid();
+       dst_die = dst_die.GetSibling()) {
     if (dst_die.Tag() == DW_TAG_subprogram) {
       // Make sure this is a declaration and not a concrete instance by looking
       // for DW_AT_declaration set to 1. Sometimes concrete function instances


        


More information about the lldb-commits mailing list