diff options
| author | Dan Gohman <gohman@apple.com> | 2009-01-13 19:08:45 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-01-13 19:08:45 +0000 |
| commit | 13141d553895502d07882bfe7e27296d8c0f9f3b (patch) | |
| tree | dfbd428d320dc5e0e47837f207d52993d63c41d8 /llvm/lib | |
| parent | 28cffd3dbc1c0cc3f8430121977359fb79994d6d (diff) | |
| download | bcm5719-llvm-13141d553895502d07882bfe7e27296d8c0f9f3b.tar.gz bcm5719-llvm-13141d553895502d07882bfe7e27296d8c0f9f3b.zip | |
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.
llvm-svn: 62173
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/ScheduleDAG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAG.cpp b/llvm/lib/CodeGen/ScheduleDAG.cpp index 730080d0fa4..62b816c1472 100644 --- a/llvm/lib/CodeGen/ScheduleDAG.cpp +++ b/llvm/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; } |

