aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-23 17:22:32 +0000
committerDan Gohman <gohman@apple.com>2008-12-23 17:22:32 +0000
commit1578f8486d401a16bdfbe7f27cd4d644920000bf (patch)
tree39e32b0312a617f2296dbf963553e125267ab655 /lib/CodeGen/ScheduleDAG.cpp
parentf900f7b5a2cc7ef45ceeeb7354e53e9fb859ede5 (diff)
downloadexternal_llvm-1578f8486d401a16bdfbe7f27cd4d644920000bf.zip
external_llvm-1578f8486d401a16bdfbe7f27cd4d644920000bf.tar.gz
external_llvm-1578f8486d401a16bdfbe7f27cd4d644920000bf.tar.bz2
Minor code simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAG.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/ScheduleDAG.cpp b/lib/CodeGen/ScheduleDAG.cpp
index 8630cfe..c2d291d 100644
--- a/lib/CodeGen/ScheduleDAG.cpp
+++ b/lib/CodeGen/ScheduleDAG.cpp
@@ -177,7 +177,7 @@ void SUnit::setHeightToAtLeast(unsigned NewHeight) {
void SUnit::ComputeDepth() {
SmallVector<SUnit*, 8> WorkList;
WorkList.push_back(this);
- while (!WorkList.empty()) {
+ do {
SUnit *Cur = WorkList.back();
bool Done = true;
@@ -202,7 +202,7 @@ void SUnit::ComputeDepth() {
}
Cur->isDepthCurrent = true;
}
- }
+ } while (!WorkList.empty());
}
/// ComputeHeight - Calculate the maximal path from the node to the entry.
@@ -210,7 +210,7 @@ void SUnit::ComputeDepth() {
void SUnit::ComputeHeight() {
SmallVector<SUnit*, 8> WorkList;
WorkList.push_back(this);
- while (!WorkList.empty()) {
+ do {
SUnit *Cur = WorkList.back();
bool Done = true;
@@ -235,7 +235,7 @@ void SUnit::ComputeHeight() {
}
Cur->isHeightCurrent = true;
}
- }
+ } while (!WorkList.empty());
}
/// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
@@ -467,7 +467,7 @@ void ScheduleDAGTopologicalSort::DFS(const SUnit *SU, int UpperBound,
WorkList.reserve(SUnits.size());
WorkList.push_back(SU);
- while (!WorkList.empty()) {
+ do {
SU = WorkList.back();
WorkList.pop_back();
Visited.set(SU->NodeNum);
@@ -482,7 +482,7 @@ void ScheduleDAGTopologicalSort::DFS(const SUnit *SU, int UpperBound,
WorkList.push_back(SU->Succs[I].getSUnit());
}
}
- }
+ } while (!WorkList.empty());
}
/// Shift - Renumber the nodes so that the topological ordering is