2 import IR.TypeDescriptor;
4 public class FlatNew extends FlatNode {
10 public FlatNew(TypeDescriptor type, TempDescriptor dst, boolean isglobal) {
14 this.isglobal=isglobal;
17 public FlatNew(TypeDescriptor type, TempDescriptor dst, TempDescriptor size, boolean isglobal) {
21 this.isglobal=isglobal;
24 public boolean isGlobal() {
28 public String toString() {
30 return dst.toString()+"= NEW "+type.toString();
32 return dst.toString()+"= NEW "+type.toString()+"["+size.toString()+"]";
39 public TempDescriptor [] writesTemps() {
40 return new TempDescriptor[] {dst};
43 public TempDescriptor [] readsTemps() {
45 return new TempDescriptor[] {size};
47 return new TempDescriptor[0];
50 public TempDescriptor getDst() {
54 public TempDescriptor getSize() {
58 public TypeDescriptor getType() {