std::function<void(HGraph*)> hook_before_codegen,
bool has_result,
Expected expected) {
+ graph->BuildDominatorTree();
SsaLivenessAnalysis liveness(*graph, codegen);
liveness.Analyze();
class HReversePostOrderIterator : public ValueObject {
public:
- explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) {}
+ explicit HReversePostOrderIterator(const HGraph& graph) : graph_(graph), index_(0) {
+ // Check that reverse post order of the graph has been built.
+ DCHECK(!graph.GetReversePostOrder().IsEmpty());
+ }
bool Done() const { return index_ == graph_.GetReversePostOrder().Size(); }
HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_); }
class HPostOrderIterator : public ValueObject {
public:
explicit HPostOrderIterator(const HGraph& graph)
- : graph_(graph), index_(graph_.GetReversePostOrder().Size()) {}
+ : graph_(graph), index_(graph_.GetReversePostOrder().Size()) {
+ // Check that reverse post order of the graph has been built.
+ DCHECK(!graph.GetReversePostOrder().IsEmpty());
+ }
bool Done() const { return index_ == 0; }
HBasicBlock* Current() const { return graph_.GetReversePostOrder().Get(index_ - 1); }
graph->AddBlock(exit);
block->AddSuccessor(exit);
exit->AddInstruction(new (allocator) HExit());
+
+ graph->BuildDominatorTree();
return graph;
}
block->AddInstruction(*second_sub);
block->AddInstruction(new (allocator) HExit());
+
+ graph->BuildDominatorTree();
return graph;
}
block->AddInstruction(*div);
block->AddInstruction(new (allocator) HExit());
+
+ graph->BuildDominatorTree();
return graph;
}