@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { return insts.GotoInstruction(iindex, target); }
@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { return insts.GotoInstruction(iindex, target); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ @Override public void visitGoto(com.ibm.wala.shrikeBT.GotoInstruction instruction) { emitInstruction(insts.GotoInstruction(getCurrentInstructionIndex(), instruction.getLabel())); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ @Override public void visitGoto(Goto instruction) { emitInstruction(insts.GotoInstruction(getCurrentInstructionIndex(), instruction.destination)); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ @Override public void visitGoto(com.ibm.wala.shrikeBT.GotoInstruction instruction) { emitInstruction(insts.GotoInstruction(getCurrentInstructionIndex(), instruction.getLabel())); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGoto(GotoInstruction) */ @Override public void visitGoto(Goto instruction) { emitInstruction(insts.GotoInstruction(getCurrentInstructionIndex(), instruction.destination)); }
mp.getIMethod().getReference(), dispatch)); methodSummary.addStatement(insts.GotoInstruction(methodSummary.getNumberOfStatements(), loopLabel));
PreBasicBlock currentBlock = getCurrentBlock(); if (!isDeadBlock(currentBlock)) { addInstruction(insts.GotoInstruction(currentInstruction, -1)); newBlock(false); doThrow(astContext, e); } else { addInstruction(insts.GotoInstruction(currentInstruction, -1));
@Override protected void leaveGoto(CAstNode n, WalkContext c, CAstVisitor<WalkContext> visitor) { WalkContext context = c; if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) { context.cfg().addPreNode(n, context.getUnwindState()); CAstControlFlowMap controlFlowMap = context.getControlFlow(); context.cfg().addPreEdge(n, controlFlowMap.getTarget(n, null), false); context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); if (controlFlowMap.getTarget(n, null) == null) { assert controlFlowMap.getTarget(n, null) != null : controlFlowMap + " does not map " + n + " (" + context.getSourceMap().getPosition(n) + ')'; } context.cfg().newBlock(false); } }
@Override protected void leaveGoto(CAstNode n, WalkContext c, CAstVisitor<WalkContext> visitor) { WalkContext context = c; if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) { context.cfg().addPreNode(n, context.getUnwindState()); CAstControlFlowMap controlFlowMap = context.getControlFlow(); context.cfg().addPreEdge(n, controlFlowMap.getTarget(n, null), false); context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); if (controlFlowMap.getTarget(n, null) == null) { assert controlFlowMap.getTarget(n, null) != null : controlFlowMap + " does not map " + n + " (" + context.getSourceMap().getPosition(n) + ')'; } context.cfg().newBlock(false); } }
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); context.cfg().newBlock(false);
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); context.cfg().newBlock(false);
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); defaultHackBlock = context.cfg().getCurrentBlock(); context.cfg().newBlock(false);
@Override protected boolean visitLoop(CAstNode n, WalkContext c, CAstVisitor<WalkContext> visitor) { WalkContext context = c; // loop test block context.cfg().newBlock(true); PreBasicBlock headerB = context.cfg().getCurrentBlock(); visitor.visit(n.getChild(0), context, visitor); assert c.getValue(n.getChild(0)) != -1 : "error in loop test " + CAstPrinter.print(n.getChild(0), context.top().getSourceMap()) + " of loop " + CAstPrinter.print(n, context.top().getSourceMap()); context.cfg().addInstruction( insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, c.getValue(n.getChild(0)), context .currentScope().getConstantValue(Integer.valueOf(0)), -1)); PreBasicBlock branchB = context.cfg().getCurrentBlock(); // loop body context.cfg().newBlock(true); visitor.visit(n.getChild(1), context, visitor); if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) { context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); PreBasicBlock bodyB = context.cfg().getCurrentBlock(); context.cfg().addEdge(bodyB, headerB); // next block context.cfg().newBlock(false); } PreBasicBlock nextB = context.cfg().getCurrentBlock(); // control flow mapping; context.cfg().addEdge(branchB, nextB); return true; }
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); defaultHackBlock = context.cfg().getCurrentBlock(); context.cfg().newBlock(false);
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); context.cfg().newBlock(false);
@Override protected boolean visitLoop(CAstNode n, WalkContext c, CAstVisitor<WalkContext> visitor) { WalkContext context = c; // loop test block context.cfg().newBlock(true); PreBasicBlock headerB = context.cfg().getCurrentBlock(); visitor.visit(n.getChild(0), context, visitor); assert c.getValue(n.getChild(0)) != -1 : "error in loop test " + CAstPrinter.print(n.getChild(0), context.top().getSourceMap()) + " of loop " + CAstPrinter.print(n, context.top().getSourceMap()); context.cfg().addInstruction( insts.ConditionalBranchInstruction(context.cfg().currentInstruction, translateConditionOpcode(CAstOperator.OP_EQ), null, c.getValue(n.getChild(0)), context .currentScope().getConstantValue(Integer.valueOf(0)), -1)); PreBasicBlock branchB = context.cfg().getCurrentBlock(); // loop body context.cfg().newBlock(true); visitor.visit(n.getChild(1), context, visitor); if (!context.cfg().isDeadBlock(context.cfg().getCurrentBlock())) { context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); PreBasicBlock bodyB = context.cfg().getCurrentBlock(); context.cfg().addEdge(bodyB, headerB); // next block context.cfg().newBlock(false); } PreBasicBlock nextB = context.cfg().getCurrentBlock(); // control flow mapping; context.cfg().addEdge(branchB, nextB); return true; }
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); context.cfg().newBlock(false);
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); trueB = context.cfg().getCurrentBlock();
context.cfg().addInstruction(insts.GotoInstruction(context.cfg().currentInstruction, -1)); trueB = context.cfg().getCurrentBlock();