adapt to wala.core IteratorPlusOne change and clean up some generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1707 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
d604c4c99e
commit
c9ed34510d
|
@ -460,8 +460,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}
|
||||
|
||||
} else {
|
||||
system.newSideEffect(new UnaryOperator() {
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
|
||||
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
|
||||
final IntSetVariable objects = (IntSetVariable) rhs;
|
||||
if (objects.getValue() != null) {
|
||||
objects.getValue().foreach(new IntSetAction() {
|
||||
|
@ -514,8 +514,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}
|
||||
|
||||
else {
|
||||
system.newSideEffect(new UnaryOperator() {
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
|
||||
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
|
||||
final IntSetVariable objects = (IntSetVariable) rhs;
|
||||
if (objects.getValue() != null) {
|
||||
objects.getValue().foreach(new IntSetAction() {
|
||||
|
@ -554,7 +554,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
//
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private abstract class LexicalOperator extends UnaryOperator {
|
||||
private abstract class LexicalOperator extends UnaryOperator<PointsToSetVariable> {
|
||||
private final AstCGNode node;
|
||||
|
||||
private final Access[] accesses;
|
||||
|
@ -616,7 +616,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}
|
||||
}
|
||||
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
|
||||
doLexicalPointerKeys();
|
||||
return NOT_CHANGED;
|
||||
}
|
||||
|
@ -1016,8 +1016,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}
|
||||
}
|
||||
|
||||
system.newSideEffect(new UnaryOperator() {
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
|
||||
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
|
||||
final IntSetVariable fields = (IntSetVariable) rhs;
|
||||
if (fields.getValue() != null) {
|
||||
fields.getValue().foreach(new IntSetAction() {
|
||||
|
@ -1057,8 +1057,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
system.recordImplicitPointsToSet(fieldKey);
|
||||
final InstanceKey[] fieldsKeys = getInvariantContents(symtab, du, opNode, fieldsVn);
|
||||
|
||||
system.newSideEffect(new UnaryOperator() {
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
system.newSideEffect(new UnaryOperator<PointsToSetVariable>() {
|
||||
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
|
||||
final IntSetVariable objects = (IntSetVariable) rhs;
|
||||
if (objects.getValue() != null) {
|
||||
objects.getValue().foreach(new IntSetAction() {
|
||||
|
@ -1103,8 +1103,8 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
|
|||
}, objKey);
|
||||
|
||||
} else {
|
||||
system.newSideEffect(new AbstractOperator() {
|
||||
public byte evaluate(IVariable lhs, final IVariable[] rhs) {
|
||||
system.newSideEffect(new AbstractOperator<PointsToSetVariable>() {
|
||||
public byte evaluate(PointsToSetVariable lhs, final IVariable[] rhs) {
|
||||
final IntSetVariable receivers = (IntSetVariable) rhs[0];
|
||||
final IntSetVariable fields = (IntSetVariable) rhs[1];
|
||||
if (receivers.getValue() != null && fields.getValue() != null) {
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.ibm.wala.dataflow.graph.IKilldallFramework;
|
|||
import com.ibm.wala.dataflow.graph.ITransferFunctionProvider;
|
||||
import com.ibm.wala.fixedpoint.impl.UnaryOperator;
|
||||
import com.ibm.wala.fixpoint.BitVectorVariable;
|
||||
import com.ibm.wala.fixpoint.IVariable;
|
||||
import com.ibm.wala.ssa.IR;
|
||||
import com.ibm.wala.ssa.SSACFG;
|
||||
import com.ibm.wala.ssa.SSAInstruction;
|
||||
|
@ -57,7 +56,7 @@ public class LiveAnalysis {
|
|||
final BitVectorIntSet liveAtExit = new BitVectorIntSet(considerLiveAtExit);
|
||||
final SSAInstruction[] instructions = (SSAInstruction[]) cfg.getInstructions();
|
||||
|
||||
final class ExitBlockGenKillOperator extends UnaryOperator {
|
||||
final class ExitBlockGenKillOperator extends UnaryOperator<BitVectorVariable> {
|
||||
public String toString() {
|
||||
return "ExitGenKill";
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ public class LiveAnalysis {
|
|||
return 37721;
|
||||
}
|
||||
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
public byte evaluate(BitVectorVariable lhs, BitVectorVariable rhs) {
|
||||
BitVectorVariable L = (BitVectorVariable) lhs;
|
||||
boolean changed = L.getValue() == null ? !considerLiveAtExit.isZero() : !L.getValue().sameValue(liveAtExit);
|
||||
|
||||
|
@ -80,7 +79,7 @@ public class LiveAnalysis {
|
|||
}
|
||||
}
|
||||
|
||||
final class BlockValueGenKillOperator extends UnaryOperator {
|
||||
final class BlockValueGenKillOperator extends UnaryOperator<BitVectorVariable> {
|
||||
private final SSACFG.BasicBlock block;
|
||||
|
||||
BlockValueGenKillOperator(SSACFG.BasicBlock block) {
|
||||
|
@ -114,7 +113,7 @@ public class LiveAnalysis {
|
|||
}
|
||||
}
|
||||
|
||||
public byte evaluate(IVariable lhs, IVariable rhs) {
|
||||
public byte evaluate(BitVectorVariable lhs, BitVectorVariable rhs) {
|
||||
BitVectorVariable L = (BitVectorVariable) lhs;
|
||||
IntSet s = ((BitVectorVariable) rhs).getValue();
|
||||
BitVectorIntSet bits = new BitVectorIntSet();
|
||||
|
@ -171,7 +170,7 @@ public class LiveAnalysis {
|
|||
return false;
|
||||
}
|
||||
|
||||
public UnaryOperator getNodeTransferFunction(IBasicBlock node) {
|
||||
public UnaryOperator<BitVectorVariable> getNodeTransferFunction(IBasicBlock node) {
|
||||
if (((SSACFG.BasicBlock) node).isExitBlock()) {
|
||||
return new ExitBlockGenKillOperator();
|
||||
} else {
|
||||
|
@ -179,12 +178,12 @@ public class LiveAnalysis {
|
|||
}
|
||||
}
|
||||
|
||||
public UnaryOperator getEdgeTransferFunction(IBasicBlock s, IBasicBlock d) {
|
||||
public UnaryOperator<BitVectorVariable> getEdgeTransferFunction(IBasicBlock s, IBasicBlock d) {
|
||||
Assertions.UNREACHABLE();
|
||||
return null;
|
||||
}
|
||||
|
||||
public AbstractMeetOperator getMeetOperator() {
|
||||
public AbstractMeetOperator<BitVectorVariable> getMeetOperator() {
|
||||
return BitVectorUnion.instance();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
return oldTarget;
|
||||
}
|
||||
|
||||
private CAstControlFlowMap copyFlow(Map nodeMap, CAstControlFlowMap orig, CAstSourcePositionMap newSrc) {
|
||||
private CAstControlFlowMap copyFlow(Map<CAstNode, CAstNode> nodeMap, CAstControlFlowMap orig, CAstSourcePositionMap newSrc) {
|
||||
Set<CAstNode> mappedOutsideNodes = HashSetFactory.make(1);
|
||||
CAstControlFlowRecorder newMap = new CAstControlFlowRecorder(newSrc);
|
||||
Collection oldSources = orig.getMappedNodes();
|
||||
|
@ -94,7 +94,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
|
|||
if (oldSources.contains(oldSource)) {
|
||||
Iterator LS = orig.getTargetLabels(oldSource).iterator();
|
||||
if (orig.getTarget(oldSource, null) != null) {
|
||||
LS = new IteratorPlusOne(LS, null);
|
||||
LS = IteratorPlusOne.make(LS, null);
|
||||
}
|
||||
|
||||
while (LS.hasNext()) {
|
||||
|
|
Loading…
Reference in New Issue