diff options
| author | 2014-10-16 13:26:29 +0000 | |
|---|---|---|
| committer | 2014-10-16 13:26:29 +0000 | |
| commit | ec2ea6ff6e3d7816df889454866a28b58ce6e6f5 (patch) | |
| tree | 41ec0fcacce25807fbc28965fb5e93d6c176c55e /compiler/optimizing/graph_checker.h | |
| parent | c15c4066233b644f3086eef80007a7cf878d4867 (diff) | |
| parent | 633021e6ff6b9a57a374a994e74cfd69275ce100 (diff) | |
Merge "Implement default traversals in CFG & SSA graph checkers."
Diffstat (limited to 'compiler/optimizing/graph_checker.h')
| -rw-r--r-- | compiler/optimizing/graph_checker.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h index 34a770b5f3..862f1b600b 100644 --- a/compiler/optimizing/graph_checker.h +++ b/compiler/optimizing/graph_checker.h @@ -29,6 +29,9 @@ class GraphChecker : public HGraphVisitor { allocator_(allocator), errors_(allocator, 0) {} + // Check the whole graph (in insertion order). + virtual void Run() { VisitInsertionOrder(); } + // Check `block`. virtual void VisitBasicBlock(HBasicBlock* block) OVERRIDE; @@ -65,6 +68,14 @@ class SSAChecker : public GraphChecker { SSAChecker(ArenaAllocator* allocator, HGraph* graph) : GraphChecker(allocator, graph) {} + // Check the whole graph (in reverse post-order). + virtual void Run() { + // VisitReversePostOrder is used instead of VisitInsertionOrder, + // as the latter might visit dead blocks removed by the dominator + // computation. + VisitReversePostOrder(); + } + // Perform SSA form checks on `block`. virtual void VisitBasicBlock(HBasicBlock* block) OVERRIDE; // Loop-related checks from block `loop_header`. |