[Lldb-commits] [PATCH] D103172: [lldb][NFC] Allow range-based for loops over DWARFDIE's children

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 26 08:39:36 PDT 2021


teemperor created this revision.
teemperor added a reviewer: LLDB.
teemperor added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a reviewer: shafik.
teemperor requested review of this revision.

This patch adds the ability to get a DWARFDIE's children as an LLVM range.

This way we can use for range loops to iterate over them and we can use
LLVM's algorithms like `llvm::all_of` to query all children.

The implementation has to do some small shenanigans as the iterator
needs to store a DWARFDIE, but a DWARFDIE container is also a DWARFDIE
so it can't return the iterator by value. I just made the `children` getter a
templated function to avoid the cyclic dependency.


https://reviews.llvm.org/D103172

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103172.347975.patch
Type: text/x-patch
Size: 9841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210526/026c1f48/attachment-0001.bin>


More information about the lldb-commits mailing list