2 import IR.TypeDescriptor;
4 public class FlatNew extends FlatNode {
11 public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal) {
15 this.isglobal=isglobal;
19 public void rewriteUse(TempMap t) {
22 public void rewriteDef(TempMap t) {
26 public FlatNode clone(TempMap t) {
27 return new FlatNew(type, t.tempMap(dst), t.tempMap(size), isglobal, disjointId);
30 public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal, String disjointId) {
34 this.isglobal=isglobal;
35 this.disjointId=disjointId;
38 public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal) {
42 this.isglobal=isglobal;
46 public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal, String disjointId) {
50 this.isglobal=isglobal;
51 this.disjointId=disjointId;
54 public boolean isGlobal() {
58 public boolean isScratch() {
62 public String getDisjointId() {
66 public String toString() {
67 String str = "FlatNew_"+dst.toString()+"= NEW "+type.toString();
69 str += "["+size.toString()+"]";
77 public TempDescriptor [] writesTemps() {
78 return new TempDescriptor[] {dst};
81 public TempDescriptor [] readsTemps() {
83 return new TempDescriptor[] {size};
85 return new TempDescriptor[0];
88 public TempDescriptor getDst() {
92 public TempDescriptor getSize() {
96 public TypeDescriptor getType() {