misched: Recompute priority queue when DFSResults are updated.

This was found by MSVC10's STL debug mode on a test from the test suite. Sadly
std::is_heap isn't standard so there is no way to assert this without writing
our own heap verify, which looks like overkill to me.

llvm-svn: 168885
This commit is contained in:
Benjamin Kramer 2012-11-29 14:36:26 +00:00
parent 7ad7e83031
commit aa598b3be6
1 changed files with 2 additions and 0 deletions

View File

@ -2117,6 +2117,8 @@ public:
virtual void registerRoots() {
DFSResult.compute(ReadyQ);
ScheduledTrees.resize(DFSResult.getNumSubtrees());
// Restore the heap in ReadyQ with the updated DFS results.
std::make_heap(ReadyQ.begin(), ReadyQ.end(), Cmp);
}
/// Implement MachineSchedStrategy interface.