summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-07-14 23:43:29 +0000
committerPete Cooper <peter_cooper@apple.com>2015-07-14 23:43:29 +0000
commit7e64ef06e6e6af9d16fedc37cd17a74d03199210 (patch)
tree63ac567a909339b4be125aa47ef69a4a20355a14 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentdeee61e4344f26f865cf9ce62c6d7b1e59956fc8 (diff)
downloadbcm5719-llvm-7e64ef06e6e6af9d16fedc37cd17a74d03199210.tar.gz
bcm5719-llvm-7e64ef06e6e6af9d16fedc37cd17a74d03199210.zip
Use more foreach loops in SelectionDAG. NFC
llvm-svn: 242249
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 14f44ccc60c..18c78b1f284 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -624,9 +624,9 @@ void SelectionDAG::RemoveDeadNodes() {
SmallVector<SDNode*, 128> DeadNodes;
// Add all obviously-dead nodes to the DeadNodes worklist.
- for (allnodes_iterator I = allnodes_begin(), E = allnodes_end(); I != E; ++I)
- if (I->use_empty())
- DeadNodes.push_back(I);
+ for (SDNode &Node : allnodes())
+ if (Node.use_empty())
+ DeadNodes.push_back(&Node);
RemoveDeadNodes(DeadNodes);
@@ -6470,8 +6470,8 @@ unsigned SelectionDAG::AssignTopologicalOrder() {
// Visit all the nodes. As we iterate, move nodes into sorted order,
// such that by the time the end is reached all nodes will be sorted.
- for (allnodes_iterator I = allnodes_begin(),E = allnodes_end(); I != E; ++I) {
- SDNode *N = I;
+ for (SDNode &Node : allnodes()) {
+ SDNode *N = &Node;
checkForCycles(N, this);
// N is in sorted position, so all its uses have one less operand
// that needs to be sorted.
@@ -6493,8 +6493,9 @@ unsigned SelectionDAG::AssignTopologicalOrder() {
P->setNodeId(Degree);
}
}
- if (I == SortedPos) {
+ if (&Node == SortedPos) {
#ifndef NDEBUG
+ allnodes_iterator I = N;
SDNode *S = ++I;
dbgs() << "Overran sorted position:\n";
S->dumprFull(this); dbgs() << "\n";
OpenPOWER on IntegriCloud