From 93e4fe8aad0a68f33e8655e6d78f1aa85582674a Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Thu, 5 Jan 2017 23:47:37 +0000 Subject: Add iterator support to DWARFDie to allow child DIE iteration. Differential Revision: https://reviews.llvm.org/D28303 llvm-svn: 291194 --- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index deec1633022..2aac3474654 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -299,11 +299,8 @@ DWARFDie::collectChildrenAddressRanges(DWARFAddressRangesVector& Ranges) const { Ranges.insert(Ranges.end(), DIERanges.begin(), DIERanges.end()); } - DWARFDie Child = getFirstChild(); - while (Child) { + for (auto Child: children()) Child.collectChildrenAddressRanges(Ranges); - Child = Child.getSibling(); - } } bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const { -- cgit v1.2.3