- for(int i=1;i<fn.numPrev();i++) {
- Hashtable<TempDescriptor, TempDescriptor> tp=table.get(fn.getPrev(i));
- if (tp==null)
- continue;
- for(Iterator tmpit=tp.entrySet().iterator();tmpit.hasNext();) {
- Map.Entry t=(Map.Entry)tmpit.next();
- TempDescriptor tmp=(TempDescriptor)t.getKey();
-
- if (!tab.containsKey(tmp))
- tab.put(tmp, tp.get(tmp));
- else if (tab.get(tmp)!=tp.get(tmp)) {
- tab.put(tmp, bogustd);
- }
- }
- }
+ for(int i=1; i<fn.numPrev(); i++) {
+ Hashtable<TempDescriptor, TempDescriptor> tp=table.get(fn.getPrev(i));
+ if (tp==null)
+ continue;
+ for(Iterator tmpit=tp.entrySet().iterator(); tmpit.hasNext(); ) {
+ Map.Entry t=(Map.Entry)tmpit.next();
+ TempDescriptor tmp=(TempDescriptor)t.getKey();
+ if (!liveset.contains(tmp))
+ continue;
+ TempDescriptor dsttmp=tp.get(tmp);
+ if (!tab.containsKey(tmp)) {
+ tab.put(tmp, dsttmp);
+ } else if (tab.get(tmp)!=dsttmp) {
+ tab.put(tmp, bogustd);
+ }
+ }
+ }
+
+ HashSet<TempDescriptor> toremove=new HashSet<TempDescriptor>();
+ TempDescriptor[] writes=fn.writesTemps();
+ for(int i=0; i<writes.length; i++) {
+ TempDescriptor tmp=writes[i];
+ toremove.add(tmp);
+ for(Iterator<TempDescriptor> tmpit=tab.keySet().iterator(); tmpit.hasNext(); ) {
+ TempDescriptor tmp2=tmpit.next();
+ if (tmp==tab.get(tmp2))
+ toremove.add(tmp2);
+ }
+ }