summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-01-13 19:08:45 +0000
committerDan Gohman <gohman@apple.com>2009-01-13 19:08:45 +0000
commita1f50e2c2cad12dd8fe7ef80e394ee7a96654021 (patch)
treed3ceaadc816a28975fec98e0a8892bddd728efff /lib/CodeGen/ScheduleDAG.cpp
parent2ecf88d1751c847b87a7119bf34fff85a3d272e2 (diff)
downloadllvm-a1f50e2c2cad12dd8fe7ef80e394ee7a96654021.tar.gz
llvm-a1f50e2c2cad12dd8fe7ef80e394ee7a96654021.tar.bz2
llvm-a1f50e2c2cad12dd8fe7ef80e394ee7a96654021.tar.xz
Avoid referring to edge D after the Succs or Preds arrays have
been modified, to avoid trouble in the (unlikely) scenario that D is a reference to an element in one of those arrays. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/ScheduleDAG.cpp b/lib/CodeGen/ScheduleDAG.cpp
index 730080d0fa..62b816c147 100644
--- a/lib/CodeGen/ScheduleDAG.cpp
+++ b/lib/CodeGen/ScheduleDAG.cpp
@@ -75,8 +75,8 @@ void SUnit::addPred(const SDep &D) {
++NumPredsLeft;
if (!isScheduled)
++N->NumSuccsLeft;
- N->Succs.push_back(P);
Preds.push_back(D);
+ N->Succs.push_back(P);
if (P.getLatency() != 0) {
this->setDepthDirty();
N->setHeightDirty();
@@ -105,8 +105,8 @@ void SUnit::removePred(const SDep &D) {
}
assert(FoundSucc && "Mismatching preds / succs lists!");
Preds.erase(I);
- // Update the bookkeeping;
- if (D.getKind() == SDep::Data) {
+ // Update the bookkeeping.
+ if (P.getKind() == SDep::Data) {
--NumPreds;
--N->NumSuccs;
}