/** * Insert a branch instruction at start of this list. * * @param i * branch instruction to insert * @return branch instruction handle of the appended instruction */ public BranchHandle insert(final BranchInstruction i) { final BranchHandle ih = BranchHandle.getBranchHandle(i); insert(ih); return ih; }
/** * Append a branch instruction to the end of this list. * * @param i branch instruction to append * @return branch instruction handle of the appended instruction */ public BranchHandle append(BranchInstruction i) { BranchHandle ih = BranchHandle.getBranchHandle(i); append(ih); return ih; }
/** * Insert a branch instruction at start of this list. * * @param i branch instruction to insert * @return branch instruction handle of the appended instruction */ public BranchHandle insert(BranchInstruction i) { BranchHandle ih = BranchHandle.getBranchHandle(i); insert(ih); return ih; }
/** * Append a branch instruction to the end of this list. * * @param i * branch instruction to append * @return branch instruction handle of the appended instruction */ public BranchHandle append(final BranchInstruction i) { final BranchHandle ih = BranchHandle.getBranchHandle(i); append(ih); return ih; }
@Test(expected=ClassGenException.class) public void testGetBHnull() { BranchHandle.getBranchHandle(null); } }
/** * Insert an instruction before instruction (handle) ih contained in this list. * * @param ih where to insert to the instruction list * @param i Instruction to insert * @return instruction handle of the first inserted instruction */ public BranchHandle insert(InstructionHandle ih, BranchInstruction i) { BranchHandle bh = BranchHandle.getBranchHandle(i); InstructionList il = new InstructionList(); il.append(bh); insert(ih, il); return bh; }
/** * Append an instruction after instruction (handle) ih contained in this list. * * @param ih * where to append the instruction list * @param i * Instruction to append * @return instruction handle pointing to the <B>first</B> appended instruction */ public BranchHandle append(final InstructionHandle ih, final BranchInstruction i) { final BranchHandle bh = BranchHandle.getBranchHandle(i); final InstructionList il = new InstructionList(); il.append(bh); append(ih, il); return bh; }
/** * Append an instruction after instruction (handle) ih contained in this list. * * @param ih where to append the instruction list * @param i Instruction to append * @return instruction handle pointing to the <B>first</B> appended instruction */ public BranchHandle append(InstructionHandle ih, BranchInstruction i) { BranchHandle bh = BranchHandle.getBranchHandle(i); InstructionList il = new InstructionList(); il.append(bh); append(ih, il); return bh; }
/** * Insert an instruction before instruction (handle) ih contained in this list. * * @param ih * where to insert to the instruction list * @param i * Instruction to insert * @return instruction handle of the first inserted instruction */ public BranchHandle insert(final InstructionHandle ih, final BranchInstruction i) { final BranchHandle bh = BranchHandle.getBranchHandle(i); final InstructionList il = new InstructionList(); il.append(bh); insert(ih, il); return bh; }
@Test(expected=ClassGenException.class) public void testsetInstructionNull() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(null); Assert.assertNotNull(bh); }
@Test(expected=ClassGenException.class) public void testsetInstructionnotBI() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(new NOP()); Assert.assertNotNull(bh); }
@Test public void testsetInstructionBI() { final BranchHandle bh = BranchHandle.getBranchHandle(new GOTO(null));// have to start with a valid BI Assert.assertNotNull(bh); bh.setInstruction(new GOTO(null)); Assert.assertNotNull(bh); }