changes: 1) fixes problems in the original EyeTracking benchmark 2) fix a bug in...
[IRC.git] / Robust / src / Analysis / SSJava / SSJavaAnalysis.java
index a39fd01..da84de6 100644 (file)
@@ -96,7 +96,7 @@ public class SSJavaAnalysis {
 
   // keep the field ownership from the linear type checking
   Hashtable<MethodDescriptor, Set<FieldDescriptor>> mapMethodToOwnedFieldSet;
-  
+
   Set<FlatNode> sameHeightWriteFlatNodeSet;
 
   CallGraph callgraph;
@@ -110,6 +110,8 @@ public class SSJavaAnalysis {
 
   private LinkedList<MethodDescriptor> sortedDescriptors;
 
+  private Map<Location, Set<Descriptor>> mapSharedLocToDescSet;
+
   public SSJavaAnalysis(State state, TypeUtil tu, BuildFlat bf, CallGraph callgraph) {
     this.state = state;
     this.tu = tu;
@@ -129,6 +131,7 @@ public class SSJavaAnalysis {
     this.mapDescriptorToSetDependents = new Hashtable<Descriptor, Set<MethodDescriptor>>();
     this.sortedDescriptors = new LinkedList<MethodDescriptor>();
     this.md2pcLoc = new HashMap<MethodDescriptor, CompositeLocation>();
+    this.mapSharedLocToDescSet = new HashMap<Location, Set<Descriptor>>();
   }
 
   public void doCheck() {
@@ -166,6 +169,17 @@ public class SSJavaAnalysis {
     return (LinkedList<MethodDescriptor>) sortedDescriptors.clone();
   }
 
+  public void addSharedDesc(Location loc, Descriptor fd) {
+    if (!mapSharedLocToDescSet.containsKey(loc)) {
+      mapSharedLocToDescSet.put(loc, new HashSet<Descriptor>());
+    }
+    mapSharedLocToDescSet.get(loc).add(fd);
+  }
+
+  public Set<Descriptor> getSharedDescSet(Location loc) {
+    return mapSharedLocToDescSet.get(loc);
+  }
+
   private void inference() {
     LocationInference inferEngine = new LocationInference(this, state);
     inferEngine.inference();