Add range iterators for post order and inverse post order. Use them

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin
2015-04-15 17:41:42 +00:00
parent 7f5438e2ca
commit 7871b86660
8 changed files with 47 additions and 37 deletions

View File

@@ -797,9 +797,8 @@ bool EarlyIfConverter::runOnMachineFunction(MachineFunction &MF) {
// if-conversion in a single pass. The tryConvertIf() function may erase
// blocks, but only blocks dominated by the head block. This makes it safe to
// update the dominator tree while the post-order iterator is still active.
for (po_iterator<MachineDominatorTree*>
I = po_begin(DomTree), E = po_end(DomTree); I != E; ++I)
if (tryConvertIf(I->getBlock()))
for (auto DomNode : post_order(DomTree))
if (tryConvertIf(DomNode->getBlock()))
Changed = true;
return Changed;