remove some codes for scheduling
[IRC.git] / Robust / src / IR / Flat / FlatMethod.java
index be3c8182877704b38da955111c77576b073a4458..b48f718ec3add0365bcf4b7d1e75d1ec43e066e4 100644 (file)
@@ -73,12 +73,12 @@ public class FlatMethod extends FlatNode {
 
     /** This method returns a set of the nodes in this flat representation */
 
-    public Set getNodeSet() {
-       HashSet tovisit=new HashSet();
-       HashSet visited=new HashSet();
+    public Set<FlatNode> getNodeSet() {
+       HashSet<FlatNode> tovisit=new HashSet<FlatNode>();
+       HashSet<FlatNode> visited=new HashSet<FlatNode>();
        tovisit.add(this);
        while(!tovisit.isEmpty()) {
-           FlatNode fn=(FlatNode)tovisit.iterator().next();
+           FlatNode fn=tovisit.iterator().next();
            tovisit.remove(fn);
            visited.add(fn);
            for(int i=0;i<fn.numNext();i++) {
@@ -90,10 +90,14 @@ public class FlatMethod extends FlatNode {
        return visited;
     }
     
+    public String printMethod() {
+       return printMethod(null);
+    }
+
     /** This method returns a string that is a human readable
      * representation of this method. */
 
-    public String printMethod() {
+    public String printMethod(Hashtable map) {
        String st=method+" {\n";
        HashSet tovisit=new HashSet();
        HashSet visited=new HashSet();
@@ -108,8 +112,6 @@ public class FlatMethod extends FlatNode {
            tovisit.remove(fn);
            visited.add(fn);
 
-//         System.out.println("Next : "+fn.numNext());
-
            for(int i=0;i<fn.numNext();i++) {
                FlatNode nn=fn.getNext(i);
                if(i>0) {
@@ -138,10 +140,16 @@ public class FlatMethod extends FlatNode {
            if (nodetolabel.containsKey(current_node))
                st+="L"+nodetolabel.get(current_node)+":\n";
            if (current_node.numNext()==0) {
-               st+="   "+current_node.toString()+"\n";
+               if (map==null)
+                   st+="   "+current_node.toString()+"\n";
+               else
+                   st+="   "+current_node.toString()+"["+map.get(current_node)+"]\n";
                current_node=null;
            } else if(current_node.numNext()==1) {
-               st+="   "+current_node.toString()+"\n";
+               if (map==null)
+                   st+="   "+current_node.toString()+"\n";
+               else
+                   st+="   "+current_node.toString()+"["+map.get(current_node)+"]\n";
                FlatNode nextnode=current_node.getNext(0);
                if (visited.contains(nextnode)) {
                    st+="goto L"+nodetolabel.get(nextnode)+"\n";