# HG changeset patch # User Andreas Woess # Date 1447182794 -3600 # Node ID ef3c3b62e0fcca12de20283ba0f3f958971301ab # Parent 0ad8cb1608be8c9c1952a0c75cf2461808c45ba0 GraphPrintVisitor: begin a graph if visit is called without beginGraph diff -r 0ad8cb1608be -r ef3c3b62e0fc truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java Tue Nov 10 14:29:08 2015 +0100 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/GraphPrintVisitor.java Tue Nov 10 20:13:14 2015 +0100 @@ -59,6 +59,7 @@ public static final String GraphVisualizerAddress = "127.0.0.1"; public static final int GraphVisualizerPort = 4444; + private static final String DEFAULT_GRAPH_NAME = "truffle tree"; private Map nodeMap; private List edgeList; @@ -481,7 +482,7 @@ public GraphPrintVisitor visit(Object node) { if (openGraphCount == 0) { - beginGraph("truffle tree"); + beginGraph(DEFAULT_GRAPH_NAME); } // if node is visited once again, skip @@ -502,6 +503,10 @@ } public GraphPrintVisitor visit(Object node, GraphPrintHandler handler) { + if (openGraphCount == 0) { + beginGraph(DEFAULT_GRAPH_NAME); + } + handler.visit(node, new GraphPrintAdapter()); return this;