/** * @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) */ public Iterator<SSAInstruction> iterateAllInstructions() { return new CompoundIterator<>(iterateNormalInstructions(), new CompoundIterator<>( iterateCatchInstructions(), new CompoundIterator<>(iteratePhis(), iteratePis()))); }
/** * @return an {@link Iterator} of all instructions (Normal, Phi, and Catch) */ public Iterator<SSAInstruction> iterateAllInstructions() { return new CompoundIterator<>(iterateNormalInstructions(), new CompoundIterator<>( iterateCatchInstructions(), new CompoundIterator<>(iteratePhis(), iteratePis()))); }
public void visitFunction(FlowGraph flowgraph, IMethod method) { { IR ir = cache.getIR(method); FlowGraphSSAVisitor visitor = new FlowGraphSSAVisitor(ir, flowgraph); // first visit normal instructions SSAInstruction[] normalInstructions = ir.getInstructions(); for(int i=0;i<normalInstructions.length;++i) if(normalInstructions[i] != null) { visitor.instructionIndex = i; normalInstructions[i].visit(visitor); } // now visit phis and catches visitor.instructionIndex = -1; for(SSAInstruction inst : Iterator2Iterable.make(ir.iteratePhis())) inst.visit(visitor); for(SSAInstruction inst : Iterator2Iterable.make(ir.iterateCatchInstructions())) inst.visit(visitor); } }
private void createEquations(OperatorFactory<T> opFactory) { SSAInstruction[] instructions = ir.getInstructions(); for (SSAInstruction s : instructions) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iteratePhis())) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iteratePis())) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iterateCatchInstructions())) { makeEquationForInstruction(opFactory, s); } }
public void visitFunction(FlowGraph flowgraph, IMethod method) { { IR ir = cache.getIR(method); FlowGraphSSAVisitor visitor = new FlowGraphSSAVisitor(ir, flowgraph); // first visit normal instructions SSAInstruction[] normalInstructions = ir.getInstructions(); for(int i=0;i<normalInstructions.length;++i) if(normalInstructions[i] != null) { visitor.instructionIndex = i; normalInstructions[i].visit(visitor); } // now visit phis and catches visitor.instructionIndex = -1; for(SSAInstruction inst : Iterator2Iterable.make(ir.iteratePhis())) inst.visit(visitor); for(SSAInstruction inst : Iterator2Iterable.make(ir.iterateCatchInstructions())) inst.visit(visitor); } }
private void createEquations(OperatorFactory<T> opFactory) { SSAInstruction[] instructions = ir.getInstructions(); for (SSAInstruction s : instructions) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iteratePhis())) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iteratePis())) { makeEquationForInstruction(opFactory, s); } for (SSAInstruction s : Iterator2Iterable.make(ir.iterateCatchInstructions())) { makeEquationForInstruction(opFactory, s); } }