use of soot.jimple.toolkits.pointer.RWSet in project soot by Sable.
the class StrayRWFinder method flowThrough.
/**
* OUT is the same as (IN minus killSet) plus the genSet.
*/
protected void flowThrough(Object inValue, Object unit, Object outValue) {
FlowSet in = (FlowSet) inValue, out = (FlowSet) outValue;
RWSet stmtRead = sea.readSet(body.getMethod(), (Stmt) unit);
RWSet stmtWrite = sea.writeSet(body.getMethod(), (Stmt) unit);
Boolean addSelf = Boolean.FALSE;
Iterator tnIt = tns.iterator();
while (tnIt.hasNext()) {
CriticalSection tn = (CriticalSection) tnIt.next();
if (stmtRead.hasNonEmptyIntersection(tn.write) || stmtWrite.hasNonEmptyIntersection(tn.read) || stmtWrite.hasNonEmptyIntersection(tn.write))
addSelf = Boolean.TRUE;
}
in.copy(out);
if (addSelf.booleanValue()) {
CriticalSection tn = new CriticalSection(false, body.getMethod(), 0);
tn.entermonitor = (Stmt) unit;
tn.units.add((Unit) unit);
tn.read.union(stmtRead);
tn.write.union(stmtWrite);
out.add(tn);
}
}