diff graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java @ 2692:79590d6b4a7c

IdealGraphPrinterObserver, GraphvizPrinterObserver: replace possibly invalid characters in file names
author Peter Hofer <peter.hofer@jku.at>
date Wed, 18 May 2011 11:50:58 +0200
parents ed36daed4c43
children b179be22a3db
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java	Wed May 18 11:27:10 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/debug/IdealGraphPrinter.java	Wed May 18 11:50:58 2011 +0200
@@ -63,20 +63,33 @@
     }
 
     /**
-     * Starts a new graph document containing a single group of graphs with the given name, short name and byte code
-     * index (BCI) as properties.
+     * Starts a new graph document.
      */
-    public void begin(String name, String shortName, int bci) {
-        stream.println("<graphDocument><group>");
+    public void begin() {
+        stream.println("<graphDocument>");
+    }
+
+    /**
+     * Starts a new group of graphs with the given name, short name and method byte code index (BCI) as properties.
+     */
+    public void beginGroup(String name, String shortName, int bci) {
+        stream.println("<group>");
         stream.printf(" <properties><p name='name'>%s</p></properties>%n", escape(name));
         stream.printf(" <method name='%s' shortName='%s' bci='%d'/>%n", escape(name), escape(shortName), bci);
     }
 
     /**
-     * Finishes the graph document.
+     * Ends the current group.
+     */
+    public void endGroup() {
+        stream.println("</group>");
+    }
+
+    /**
+     * Finishes the graph document and flushes the output stream.
      */
     public void end() {
-        stream.println("</group></graphDocument>");
+        stream.println("</graphDocument>");
         stream.flush();
     }