2 import IR.MethodDescriptor;
4 public class FlatCall extends FlatNode {
6 TempDescriptor this_temp;
8 MethodDescriptor method;
10 public FlatCall(MethodDescriptor md, TempDescriptor dst, TempDescriptor this_temp, TempDescriptor[] args) {
13 this.this_temp=this_temp;
17 public MethodDescriptor getMethod() {
21 public TempDescriptor getThis() {
25 public TempDescriptor getReturnTemp() {
29 public int numArgs() {
33 public TempDescriptor getArg(int i) {
37 public String toString() {
40 st+=method.getSymbol()+"(";
42 st+=dst+"="+method.getSymbol()+"(";
43 if (this_temp!=null) {
49 for(int i=0;i<args.length;i++) {
50 st+=args[i].toString();
51 if ((i+1)<args.length)
58 return FKind.FlatCall;
61 public TempDescriptor [] readsTemps() {
65 TempDescriptor [] t=new TempDescriptor[size];
68 t[offset++]=this_temp;
69 for(int i=0;i<args.length;i++)
74 public TempDescriptor [] writesTemps() {
76 return new TempDescriptor[] {dst};
78 return new TempDescriptor[0];