Use SmallVector's pop_back_val.
authorDan Gohman <gohman@apple.com>
Sat, 20 Dec 2008 16:42:33 +0000 (16:42 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 20 Dec 2008 16:42:33 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61277 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAG.cpp

index 59fd341e31a3dbd0556815795b719de919ccece4..3ec538cf2fcc34319b1b74dbb0d99a312d4b97e2 100644 (file)
@@ -122,8 +122,7 @@ void SUnit::setDepthDirty() {
   SmallVector<SUnit*, 8> WorkList;
   WorkList.push_back(this);
   while (!WorkList.empty()) {
-    SUnit *SU = WorkList.back();
-    WorkList.pop_back();
+    SUnit *SU = WorkList.pop_back_val();
     if (!SU->isDepthCurrent) continue;
     SU->isDepthCurrent = false;
     for (SUnit::const_succ_iterator I = SU->Succs.begin(),
@@ -136,8 +135,7 @@ void SUnit::setHeightDirty() {
   SmallVector<SUnit*, 8> WorkList;
   WorkList.push_back(this);
   while (!WorkList.empty()) {
-    SUnit *SU = WorkList.back();
-    WorkList.pop_back();
+    SUnit *SU = WorkList.pop_back_val();
     if (!SU->isHeightCurrent) continue;
     SU->isHeightCurrent = false;
     for (SUnit::const_pred_iterator I = SU->Preds.begin(),