From d11bc85445aca6e9042fca37fb7818a89d6e45f5 Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 11 May 2011 21:16:36 +0000 Subject: [PATCH] allow external systems to write a flatIR graph --- .../src/Analysis/FlatIRGraph/FlatIRGraph.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java b/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java index 7211dd99..79a4414b 100644 --- a/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java +++ b/Robust/src/Analysis/FlatIRGraph/FlatIRGraph.java @@ -9,14 +9,6 @@ public class FlatIRGraph { private State state; - private BufferedWriter flatbw; - - private HashSet visited; - private HashSet toVisit; - - private int labelindex; - private Hashtable flatnodetolabel; - public FlatIRGraph(State state, boolean tasks, boolean usermethods, boolean libmethods) throws java.io.IOException { this.state=state; @@ -46,7 +38,21 @@ public class FlatIRGraph { } } - private void writeFlatIRGraph(FlatMethod fm, String graphname) throws java.io.IOException { + + + static BufferedWriter flatbw; + + static HashSet visited; + static HashSet toVisit; + + static int labelindex; + static Hashtable flatnodetolabel; + + + static public void writeFlatIRGraph(FlatMethod fm, String graphname) throws java.io.IOException { + + + // give every node in the flat IR graph a unique label // so a human being can inspect the graph and verify // correctness @@ -91,7 +97,8 @@ public class FlatIRGraph { flatbw.close(); } - private void labelFlatNodes(FlatNode fn) { + + static private void labelFlatNodes(FlatNode fn) { visited.add(fn); flatnodetolabel.put(fn,new Integer(labelindex++)); for(int i=0; i