Change tabbing for everything....
[IRC.git] / Robust / src / IR / Flat / FlatNew.java
index f4ef5ccf2e6c60656011f17eef9de3be75a3e1a4..eec4beb44d950dad8834ab71dfc42d6369f98e05 100644 (file)
@@ -2,49 +2,60 @@ package IR.Flat;
 import IR.TypeDescriptor;
 
 public class FlatNew extends FlatNode {
-    TempDescriptor dst;
-    TypeDescriptor type;
-    TempDescriptor size;
-    
-    public FlatNew(TypeDescriptor type, TempDescriptor dst) {
-       this.type=type;
-       this.dst=dst;
-       this.size=null;
-    }
-
-    public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size) {
-       this.type=type;
-       this.dst=dst;
-       this.size=size;
-    }
-
-    public String toString() {
-       if (size==null)
-           return dst.toString()+"= NEW "+type.toString();
-       else
-           return dst.toString()+"= NEW "+type.toString()+"["+size.toString()+"]";
-    }
-
-    public int kind() {
-       return FKind.FlatNew;
-    }
-
-    public TempDescriptor [] writesTemps() {
-       return new TempDescriptor[] {dst};
-    }
-
-    public TempDescriptor [] readsTemps() {
-       if (size!=null)
-           return new TempDescriptor[] {size};
-       else
-           return new TempDescriptor[0];
-    }
-
-    public TempDescriptor getDst() {
-       return dst;
-    }
-
-    public TypeDescriptor getType() {
-       return type;
-    }
+  TempDescriptor dst;
+  TypeDescriptor type;
+  TempDescriptor size;
+  boolean isglobal;
+
+  public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal) {
+    this.type=type;
+    this.dst=dst;
+    this.size=null;
+    this.isglobal=isglobal;
+  }
+
+  public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal) {
+    this.type=type;
+    this.dst=dst;
+    this.size=size;
+    this.isglobal=isglobal;
+  }
+
+  public boolean isGlobal() {
+    return isglobal;
+  }
+
+  public String toString() {
+    String str = "FlatNew_"+dst.toString()+"= NEW "+type.toString();
+    if (size!=null)
+      str += "["+size.toString()+"]";
+    return str;
+  }
+
+  public int kind() {
+    return FKind.FlatNew;
+  }
+
+  public TempDescriptor [] writesTemps() {
+    return new TempDescriptor[] {dst};
+  }
+
+  public TempDescriptor [] readsTemps() {
+    if (size!=null)
+      return new TempDescriptor[] {size};
+    else
+      return new TempDescriptor[0];
+  }
+
+  public TempDescriptor getDst() {
+    return dst;
+  }
+
+  public TempDescriptor getSize() {
+    return size;
+  }
+
+  public TypeDescriptor getType() {
+    return type;
+  }
 }