diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2020-05-18 16:28:24 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2020-07-06 21:58:11 +0200 |
commit | 76c5cb05a3a67340cc7950eb8fb5c2d2a0ac4554 (patch) | |
tree | 19dfb793d0eea796c7b33da33cee01718c6d859d /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | 16d83c395a1f8660fc583a66e1927a5c433fbbe1 (diff) | |
download | llvm-76c5cb05a3a67340cc7950eb8fb5c2d2a0ac4554.zip llvm-76c5cb05a3a67340cc7950eb8fb5c2d2a0ac4554.tar.gz llvm-76c5cb05a3a67340cc7950eb8fb5c2d2a0ac4554.tar.bz2 |
DomTree: Remove getChildren() accessor
Summary:
Avoid exposing details about how children are stored. This will enable
subsequent type-erasure changes.
New methods are introduced to cover common access patterns.
Change-Id: Idb5f4b1b9c84e4cc71ddb39bb52a388682f5674f
Reviewers: arsenm, RKSimon, mehdi_amini, courbet
Subscribers: qcolombet, sdardis, wdng, hiraditya, jrtc27, zzheng, atanasyan, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83083
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index c33f36f..a8445e9 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -696,10 +696,8 @@ ReprocessLoop: LI->removeBlock(ExitingBlock); DomTreeNode *Node = DT->getNode(ExitingBlock); - const std::vector<DomTreeNodeBase<BasicBlock> *> &Children = - Node->getChildren(); - while (!Children.empty()) { - DomTreeNode *Child = Children.front(); + while (!Node->isLeaf()) { + DomTreeNode *Child = Node->back(); DT->changeImmediateDominator(Child, Node->getIDom()); } DT->eraseNode(ExitingBlock); |