OSDN Git Service

Fix codegen_test after DCE fix.
authorNicolas Geoffray <ngeoffray@google.com>
Wed, 24 Jun 2015 13:25:09 +0000 (14:25 +0100)
committerNicolas Geoffray <ngeoffray@google.com>
Wed, 24 Jun 2015 13:26:01 +0000 (14:26 +0100)
Change-Id: I16c64abc26c64815da4cb4034276d60e9bfb6996

compiler/optimizing/codegen_test.cc

index ca85cf5..4fbb51d 100644 (file)
@@ -192,7 +192,10 @@ static void RunCodeOptimized(CodeGenerator* codegen,
                              std::function<void(HGraph*)> hook_before_codegen,
                              bool has_result,
                              Expected expected) {
-  graph->BuildDominatorTree();
+  // Tests may have already computed it.
+  if (graph->GetReversePostOrder().IsEmpty()) {
+    graph->BuildDominatorTree();
+  }
   SsaLivenessAnalysis liveness(graph, codegen);
   liveness.Analyze();