2 import java.util.Vector;
5 public class FlatOpNode extends FlatNode {
11 public FlatOpNode(TempDescriptor dest, TempDescriptor left, TempDescriptor right, Operation op) {
18 public FlatNode clone(TempMap t) {
19 return new FlatOpNode(t.tempMap(dest), t.tempMap(left), t.tempMap(right), op);
21 public void rewriteDef(TempMap t) {
24 public void rewriteUse(TempMap t) {
26 right=t.tempMap(right);
29 public TempDescriptor getDest() {
33 public TempDescriptor getLeft() {
37 public TempDescriptor getRight() {
41 public Operation getOp() {
45 public String toString() {
46 String str = "FlatOpNode_"+dest.toString();
48 str += "="+left.toString()+op.toString()+right.toString();
49 else if (op.getOp()==Operation.ASSIGN)
50 str += " = "+left.toString();
52 str += " "+op.toString() +" "+left.toString();
57 return FKind.FlatOpNode;
60 public TempDescriptor [] readsTemps() {
62 return new TempDescriptor [] {left,right};
64 return new TempDescriptor [] {left};
67 public TempDescriptor [] writesTemps() {
68 return new TempDescriptor [] {dest};