From 95ff6906f9e3f117931ea2587c527c08da7eb886 Mon Sep 17 00:00:00 2001 From: jjenista Date: Thu, 9 Apr 2009 23:16:52 +0000 Subject: [PATCH] quick capture of some stable structures --- Robust/src/Analysis/MLP/VarSrcTokTable.java | 86 +++++++++++++++++++++ Robust/src/Tests/mlp/tinyTest/makefile | 1 + 2 files changed, 87 insertions(+) diff --git a/Robust/src/Analysis/MLP/VarSrcTokTable.java b/Robust/src/Analysis/MLP/VarSrcTokTable.java index 145c8292..62b385d0 100644 --- a/Robust/src/Analysis/MLP/VarSrcTokTable.java +++ b/Robust/src/Analysis/MLP/VarSrcTokTable.java @@ -22,7 +22,93 @@ public class VarSrcTokTable { public void add( VariableSourceToken vst ) { + Set s; + s = sese2vst.get( vst.getSESE() ); + if( s == null ) { + s = new HashSet(); + } + s.add( vst ); + sese2vst.put( vst.getSESE(), s ); + + s = var2vst.get( vst.getVar() ); + if( s == null ) { + s = new HashSet(); + } + 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(); + } + s.add( vst ); + sv2vst.put( key, s ); + } + + + public Set get( FlatSESEEnterNode sese ) { + Set s = sese2vst.get( sese ); + if( s == null ) { + s = new HashSet(); + } + return s; + } + + public Set get( TempDescriptor var ) { + Set s = var2vst.get( var ); + if( s == null ) { + s = new HashSet(); + } + return s; + } + + public Set get( SVKey key ) { + Set s = sv2vst.get( key ); + if( s == null ) { + s = new HashSet(); + } + 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 s = sese2vst.get( sese ); + if( s == null ) { + return; + } + + Iterator vstItr = s.iterator(); + while( vstItr.hasNext() ) { + VariableSourceToken vst = vstItr.next(); + + /* + TempDescriptor var = vst.getVar(); + + sv2vst.remove( new SVKey( sese, var ) ); + + Set sByVar = var2vst.get( var ); + if( sByVar == null ) { + continue; + } + Iterator byVarItr = sByVar.clone().iterator(); + while( byVarItr.hasNext() ) { + VariableSourceToken vstByVar = byVarItr.next(); + + + } + */ + } + + sese2vst.remove( sese ); } diff --git a/Robust/src/Tests/mlp/tinyTest/makefile b/Robust/src/Tests/mlp/tinyTest/makefile index d23651f8..7364b2c7 100644 --- a/Robust/src/Tests/mlp/tinyTest/makefile +++ b/Robust/src/Tests/mlp/tinyTest/makefile @@ -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 -- 2.34.1