@Override protected void placeNewPhiAt(int value, SSACFG.BasicBlock Y) { int[] params = new int[CFG.getPredNodeCount(Y)]; for (int i = 0; i < params.length; i++) params[i] = value; SSAPhiInstruction phi = new SSAPhiInstruction(SSAInstruction.NO_INDEX, value, params); if (DEBUG) System.err.println(("Placing " + phi + " at " + Y)); addPhi(Y, phi); }
@Override protected void placeNewPhiAt(int value, SSACFG.BasicBlock Y) { int[] params = new int[CFG.getPredNodeCount(Y)]; for (int i = 0; i < params.length; i++) params[i] = value; SSAPhiInstruction phi = new SSAPhiInstruction(SSAInstruction.NO_INDEX, value, params); if (DEBUG) System.err.println(("Placing " + phi + " at " + Y)); addPhi(Y, phi); }
@Override public Collection<ISSABasicBlock> getNormalPredecessors(ISSABasicBlock b) { if (b == null) { throw new IllegalArgumentException("b is null"); } IBasicBlock<IInstruction> n = delegate.getNode(b.getNumber()); final Collection<IBasicBlock<IInstruction>> ss = delegate.getNormalPredecessors(n); Collection<ISSABasicBlock> c = new ArrayList<>(getPredNodeCount(b)); for (IBasicBlock<IInstruction> s : ss) { c.add(basicBlocks[delegate.getNumber(s)]); } return c; }
@Override public Collection<ISSABasicBlock> getNormalPredecessors(ISSABasicBlock b) { if (b == null) { throw new IllegalArgumentException("b is null"); } IBasicBlock<IInstruction> n = delegate.getNode(b.getNumber()); final Collection<IBasicBlock<IInstruction>> ss = delegate.getNormalPredecessors(n); Collection<ISSABasicBlock> c = new ArrayList<>(getPredNodeCount(b)); for (IBasicBlock<IInstruction> s : ss) { c.add(basicBlocks[delegate.getNumber(s)]); } return c; }
@Override public int getPredNodeCount(IExplodedBasicBlock bb) throws IllegalArgumentException { ExplodedBasicBlock eb = (ExplodedBasicBlock) bb; if (eb == null) { throw new IllegalArgumentException("eb == null"); } if (eb.isEntryBlock()) { return 0; } if (eb.isExitBlock()) { return ir.getControlFlowGraph().getPredNodeCount(ir.getControlFlowGraph().exit()); } if (eb.instructionIndex == eb.original.getFirstInstructionIndex()) { if (eb.original.isEntryBlock()) { return 1; } else { return ir.getControlFlowGraph().getPredNodeCount(eb.original); } } else { return 1; } }
@Override public int getPredNodeCount(IExplodedBasicBlock bb) throws IllegalArgumentException { ExplodedBasicBlock eb = (ExplodedBasicBlock) bb; if (eb == null) { throw new IllegalArgumentException("eb == null"); } if (eb.isEntryBlock()) { return 0; } if (eb.isExitBlock()) { return ir.getControlFlowGraph().getPredNodeCount(ir.getControlFlowGraph().exit()); } if (eb.instructionIndex == eb.original.getFirstInstructionIndex()) { if (eb.original.isEntryBlock()) { return 1; } else { return ir.getControlFlowGraph().getPredNodeCount(eb.original); } } else { return 1; } }