changeset 14788:f0da23ee8315

Work around printCFG / AbstractBlock issue.
author Josef Eisl <josef.eisl@jku.at>
date Wed, 12 Mar 2014 16:49:24 +0100
parents 6ce74db1c9fb
children 1596a21c4194
files graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Wed Mar 12 13:38:12 2014 +0100
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Wed Mar 12 16:49:24 2014 +0100
@@ -127,10 +127,11 @@
      * @param label A label describing the compilation phase that produced the control flow graph.
      * @param blocks The list of blocks to be printed.
      */
-    public void printCFG(String label, List<Block> blocks, boolean printNodes) {
+    public void printCFG(String label, List<? extends AbstractBlock<?>> blocks, boolean printNodes) {
         if (lir == null) {
             latestScheduling = new NodeMap<>(cfg.getNodeToBlock());
-            for (Block block : blocks) {
+            for (AbstractBlock<?> abstractBlock : blocks) {
+                Block block = (Block) abstractBlock;
                 Node cur = block.getBeginNode();
                 while (true) {
                     assert inFixedSchedule(cur) && latestScheduling.get(cur) == block;
@@ -148,7 +149,8 @@
 
         begin("cfg");
         out.print("name \"").print(label).println('"');
-        for (Block block : blocks) {
+        for (AbstractBlock<?> abstractBlock : blocks) {
+            Block block = (Block) abstractBlock;
             printBlock(block, printNodes);
         }
         end("cfg");
@@ -239,6 +241,10 @@
     }
 
     private void printNodes(Block block) {
+        if (latestScheduling == null) {
+            // TODO: this should go away as soon as the Block/AbstractBlock transit is finished.
+            return;
+        }
         begin("IR");
         out.println("HIR");
         out.disableIndentation();
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Wed Mar 12 13:38:12 2014 +0100
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Wed Mar 12 16:49:24 2014 +0100
@@ -160,7 +160,7 @@
             // No need to print the HIR nodes again if this is not the first
             // time dumping the same LIR since the HIR will not have changed.
             boolean printNodes = previousObject != object;
-            cfgPrinter.printCFG(message, (List<Block>) cfgPrinter.lir.codeEmittingOrder(), printNodes);
+            cfgPrinter.printCFG(message, cfgPrinter.lir.codeEmittingOrder(), printNodes);
 
         } else if (object instanceof StructuredGraph) {
             if (cfgPrinter.cfg == null) {