Index: src/compiler/verifier.cc |
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc |
index 23cec7a809794623625823e99d8f0b2688508d6b..972fec41b5dd3bcacf2152a708ec21494e36bb10 100644 |
--- a/src/compiler/verifier.cc |
+++ b/src/compiler/verifier.cc |
@@ -304,6 +304,17 @@ void ScheduleVerifier::Run(Schedule* schedule) { |
for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); |
++b) { |
CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); |
+ // All predecessors and successors should be in rpo and in this schedule. |
+ BasicBlock::Predecessors p = (*b)->predecessors(); |
+ for (BasicBlock::Predecessors::iterator j = p.begin(); j != p.end(); ++j) { |
+ CHECK_GE((*j)->rpo_number_, 0); |
+ CHECK_EQ((*j), schedule->GetBlockById((*j)->id())); |
+ } |
+ BasicBlock::Successors s = (*b)->successors(); |
+ for (BasicBlock::Successors::iterator j = s.begin(); j != s.end(); ++j) { |
+ CHECK_GE((*j)->rpo_number_, 0); |
+ CHECK_EQ((*j), schedule->GetBlockById((*j)->id())); |
+ } |
} |
// Verify RPO numbers of blocks. |