diff options
author | Greg Clayton <gclayton@apple.com> | 2017-01-05 23:47:37 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2017-01-05 23:47:37 +0000 |
commit | 93e4fe8aad0a68f33e8655e6d78f1aa85582674a (patch) | |
tree | 1b6c7401a6cc85eb52dd0a5dd57154a98f19aa0e /llvm/tools/dsymutil/DwarfLinker.cpp | |
parent | ce542eefe3eb3b4c2e1b40d3dfda55f0f8183904 (diff) | |
download | bcm5719-llvm-93e4fe8aad0a68f33e8655e6d78f1aa85582674a.tar.gz bcm5719-llvm-93e4fe8aad0a68f33e8655e6d78f1aa85582674a.zip |
Add iterator support to DWARFDie to allow child DIE iteration.
Differential Revision: https://reviews.llvm.org/D28303
llvm-svn: 291194
Diffstat (limited to 'llvm/tools/dsymutil/DwarfLinker.cpp')
-rw-r--r-- | llvm/tools/dsymutil/DwarfLinker.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index 018d91d6c31..ecd631c1039 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -1796,8 +1796,7 @@ static bool analyzeContextInfo(const DWARFDie &DIE, Info.Prune = InImportedModule; if (DIE.hasChildren()) - for (auto Child = DIE.getFirstChild(); Child && !Child.isNULL(); - Child = Child.getSibling()) + for (auto Child: DIE.children()) Info.Prune &= analyzeContextInfo(Child, MyIdx, CU, CurrentDeclContext, StringPool, Contexts, InImportedModule); @@ -2294,8 +2293,7 @@ void DwarfLinker::lookForDIEsToKeep(RelocationManager &RelocMgr, if (!Die.hasChildren() || (Flags & TF_ParentWalk)) return; - for (auto Child = Die.getFirstChild(); Child && !Child.isNULL(); - Child = Child.getSibling()) + for (auto Child: Die.children()) lookForDIEsToKeep(RelocMgr, Child, DMO, CU, Flags); } @@ -2814,8 +2812,7 @@ DIE *DwarfLinker::DIECloner::cloneDIE( // Determine whether there are any children that we want to keep. bool HasChildren = false; - for (auto Child = InputDIE.getFirstChild(); Child && !Child.isNULL(); - Child = Child.getSibling()) { + for (auto Child: InputDIE.children()) { unsigned Idx = U.getDIEIndex(Child); if (Unit.getInfo(Idx).Keep) { HasChildren = true; @@ -2840,8 +2837,7 @@ DIE *DwarfLinker::DIECloner::cloneDIE( } // Recursively clone children. - for (auto Child = InputDIE.getFirstChild(); Child && !Child.isNULL(); - Child = Child.getSibling()) { + for (auto Child: InputDIE.children()) { if (DIE *Clone = cloneDIE(Child, Unit, PCOffset, OutOffset, Flags)) { Die->addChild(Clone); OutOffset = Clone->getOffset() + Clone->getSize(); |