Previous fix is still buggy, this one really fix that bug
[IRC.git] / Robust / src / Analysis / Liveness.java
index 9f93732d2850332f078aab1e025d5ef9de8b5831..b4b3a8dcf017a5a513375d1b7040f54977bb61ae 100644 (file)
@@ -72,8 +72,18 @@ public class Liveness {
   // Also allow an instantiation of this object that memoizes results
   protected Hashtable< FlatMethod, Hashtable< FlatNode, Set<TempDescriptor> > > fm2liveMap;
 
+  protected Hashtable< FlatMethod, Hashtable< FlatNode, Set<TempDescriptor> > > fm2liveOutMap;
+
   public Liveness() {
     fm2liveMap = new Hashtable< FlatMethod, Hashtable< FlatNode, Set<TempDescriptor> > >();
+    fm2liveOutMap = new Hashtable< FlatMethod, Hashtable< FlatNode, Set<TempDescriptor> > >();
+  }
+
+  public Set<TempDescriptor> getLiveOutTemps( FlatMethod fm, FlatNode fn ) {
+    if( !fm2liveOutMap.containsKey( fm ) ) {
+      fm2liveOutMap.put( fm, Liveness.computeLiveOut( fm ) );
+    }
+    return fm2liveOutMap.get( fm ).get( fn );
   }
 
   public Set<TempDescriptor> getLiveInTemps( FlatMethod fm, FlatNode fn ) {