# HG changeset patch # User Josef Eisl # Date 1394639364 -3600 # Node ID f0da23ee8315077887e028f9e2272208f530e4af # Parent 6ce74db1c9fb9e360779e2c589dd16de8862a00a Work around printCFG / AbstractBlock issue. diff -r 6ce74db1c9fb -r f0da23ee8315 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- 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 blocks, boolean printNodes) { + public void printCFG(String label, List> 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(); diff -r 6ce74db1c9fb -r f0da23ee8315 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java --- 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) cfgPrinter.lir.codeEmittingOrder(), printNodes); + cfgPrinter.printCFG(message, cfgPrinter.lir.codeEmittingOrder(), printNodes); } else if (object instanceof StructuredGraph) { if (cfgPrinter.cfg == null) {