Compiler/runtime modifications towards supporting precise garbage collection
[IRC.git] / Robust / src / IR / Flat / TempDescriptor.java
1 package IR.Flat;
2 import IR.*;
3
4 public class TempDescriptor extends Descriptor {
5     static int currentid=0;
6     int id;
7     //    String safename;
8     TypeDescriptor type;
9
10     public TempDescriptor(String name) {
11         super(name);
12         id=currentid++;
13     }
14
15     public TempDescriptor(String name, TypeDescriptor td) {
16         this(name);
17         type=td;
18     }
19     
20     public static TempDescriptor tempFactory() {
21         return new TempDescriptor("temp_"+currentid);
22     }
23
24     public static TempDescriptor tempFactory(String name) {
25         return new TempDescriptor(name+currentid);
26     }
27
28     public static TempDescriptor tempFactory(String name, TypeDescriptor td) {
29         return new TempDescriptor(name+currentid,td);
30     }
31
32     public static TempDescriptor paramtempFactory(String name, TypeDescriptor td) {
33         return new TempDescriptor(name,td);
34     }
35
36
37     public String toString() {
38         return safename;
39     }
40
41     public void setType(TypeDescriptor td) {
42         type=td;
43     }
44
45     public TypeDescriptor getType() {
46         return type;
47     }
48 }