diff options
| author | Justin Lebar <jlebar@google.com> | 2016-11-22 23:13:37 +0000 |
|---|---|---|
| committer | Justin Lebar <jlebar@google.com> | 2016-11-22 23:13:37 +0000 |
| commit | 1b60d7002574e7201c776ff649ade6d32bec6a41 (patch) | |
| tree | e40b86ba1df3078b469952023aa97961a4183769 /llvm/lib/Transforms | |
| parent | c7445d5731fa76f7f35d8d1c02e1f2e9413f3106 (diff) | |
| download | bcm5719-llvm-1b60d7002574e7201c776ff649ade6d32bec6a41.tar.gz bcm5719-llvm-1b60d7002574e7201c776ff649ade6d32bec6a41.zip | |
[StructurizeCFG] Use a for-each loop instead of iterators in runOnRegion.
Summary:
Reviewers: arsenm
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D26993
llvm-svn: 287717
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp index 57c1997863c..6232bef8079 100644 --- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -939,12 +939,11 @@ bool StructurizeCFG::runOnRegion(Region *R, RGPassManager &RGM) { // sub-regions are treated more cleverly, indirect children are not // marked as uniform. MDNode *MD = MDNode::get(R->getEntry()->getParent()->getContext(), {}); - Region::element_iterator E = R->element_end(); - for (Region::element_iterator I = R->element_begin(); I != E; ++I) { - if (I->isSubRegion()) + for (RegionNode *E : R->elements()) { + if (E->isSubRegion()) continue; - if (Instruction *Term = I->getEntry()->getTerminator()) + if (Instruction *Term = E->getEntry()->getTerminator()) Term->setMetadata("structurizecfg.uniform", MD); } |

