quick capture of some stable structures
authorjjenista <jjenista>
Thu, 9 Apr 2009 23:16:52 +0000 (23:16 +0000)
committerjjenista <jjenista>
Thu, 9 Apr 2009 23:16:52 +0000 (23:16 +0000)
Robust/src/Analysis/MLP/VarSrcTokTable.java
Robust/src/Tests/mlp/tinyTest/makefile

index 145c8292d2f8e8b26d60897728fdb9486d51b972..62b385d0811e4604907174e996d874e7bb091d48 100644 (file)
@@ -22,7 +22,93 @@ public class VarSrcTokTable {
 
 
   public void add( VariableSourceToken vst ) {
+    Set<VariableSourceToken> s;
 
+    s = sese2vst.get( vst.getSESE() );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();
+    }
+    s.add( vst );
+    sese2vst.put( vst.getSESE(), s );
+
+    s = var2vst.get( vst.getVar() );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();
+    }
+    s.add( vst );
+    var2vst.put( vst.getVar(), s );
+
+    SVKey key = new SVKey( vst.getSESE(), vst.getVar() );
+    s = sv2vst.get( key );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();
+    }
+    s.add( vst );
+    sv2vst.put( key, s );
+  }
+
+
+  public Set<VariableSourceToken> get( FlatSESEEnterNode sese ) {
+    Set<VariableSourceToken> s = sese2vst.get( sese );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();      
+    }
+    return s;
+  }
+
+  public Set<VariableSourceToken> get( TempDescriptor var ) {
+    Set<VariableSourceToken> s = var2vst.get( var );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();      
+    }
+    return s;
+  }
+
+  public Set<VariableSourceToken> get( SVKey key ) {
+    Set<VariableSourceToken> s = sv2vst.get( key );
+    if( s == null ) {
+      s = new HashSet<VariableSourceToken>();      
+    }
+    return s;
+  }
+
+
+  public void merge( VarSrcTokTable table ) {
+    sese2vst.putall( table.sese2vst );
+     var2vst.putall( table.var2vst  );
+      sv2vst.putall( table.sv2vst   );
+  }
+
+
+  public void remove( FlatSESEEnterNode sese ) {
+    Set<VariableSourceToken> s = sese2vst.get( sese );
+    if( s == null ) {
+      return;
+    }
+
+    Iterator<VariableSourceToken> vstItr = s.iterator();
+    while( vstItr.hasNext() ) {
+      VariableSourceToken vst = vstItr.next();      
+
+       /*
+      TempDescriptor      var = vst.getVar();
+
+      sv2vst.remove( new SVKey( sese, var ) );
+
+      Set<VariableSourceToken> sByVar = var2vst.get( var );
+      if( sByVar == null ) {
+        continue;
+      }
+      Iterator<VariableSourceToken> byVarItr = sByVar.clone().iterator();
+      while( byVarItr.hasNext() ) {
+       VariableSourceToken vstByVar = byVarItr.next();
+
+       
+      }
+       */
+    }
+        
+    sese2vst.remove( sese );
   }
 
 
index d23651f8acd46a89654d0c115da0e4778f2ccaae..7364b2c71bc617efbc6722029c30360be35f3a3c 100644 (file)
@@ -6,6 +6,7 @@ BUILDSCRIPT=~/research/Robust/src/buildscript
 #BSFLAGS= -mlpdebug -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt #-justanalyze -recover 
 BSFLAGS= -mainclass Test -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions -flatirusermethods -ownaliasfile aliases.txt #-justanalyze -recover 
 
+
 all: $(PROGRAM).bin
 
 view: PNGs