/** * Return the {@link ISSABasicBlock} corresponding to a particular catch instruction */ public ISSABasicBlock getBasicBlockForCatch(SSAGetCaughtExceptionInstruction instruction) { if (instruction == null) { throw new IllegalArgumentException("instruction is null"); } int bb = instruction.getBasicBlockNumber(); return cfg.getBasicBlock(bb); }
/** * Return the {@link ISSABasicBlock} corresponding to a particular catch instruction */ public ISSABasicBlock getBasicBlockForCatch(SSAGetCaughtExceptionInstruction instruction) { if (instruction == null) { throw new IllegalArgumentException("instruction is null"); } int bb = instruction.getBasicBlockNumber(); return cfg.getBasicBlock(bb); }
/** * This is ugly. Clean it up someday. {@link InducedCFG}s carry around pii instructions. add these pii instructions to the * SSABasicBlocks */ private void addPisFromInducedCFG(InducedCFG cfg) { for (com.ibm.wala.cfg.InducedCFG.BasicBlock ib : cfg) { // we rely on the invariant that basic blocks in this cfg are numbered identically as in the source // InducedCFG BasicBlock b = getBasicBlock(ib.getNumber()); for (SSAPiInstruction pi : ib.getPis()) { BasicBlock path = getBasicBlock(pi.getSuccessor()); b.addPiForRefAndPath(pi.getVal(), path, pi); } } }
/** * This is ugly. Clean it up someday. {@link InducedCFG}s carry around pii instructions. add these pii instructions to the * SSABasicBlocks */ private void addPisFromInducedCFG(InducedCFG cfg) { for (com.ibm.wala.cfg.InducedCFG.BasicBlock ib : cfg) { // we rely on the invariant that basic blocks in this cfg are numbered identically as in the source // InducedCFG BasicBlock b = getBasicBlock(ib.getNumber()); for (SSAPiInstruction pi : ib.getPis()) { BasicBlock path = getBasicBlock(pi.getSuccessor()); b.addPiForRefAndPath(pi.getVal(), path, pi); } } }
/** * This is ugly. Clean it up someday. {@link InducedCFG}s carry around phi instructions. add these phi instructions to the * SSABasicBlocks */ private void addPhisFromInducedCFG(InducedCFG cfg) { for (com.ibm.wala.cfg.InducedCFG.BasicBlock ib : cfg) { // we rely on the invariant that basic blocks in this cfg are numbered identically as in the source // InducedCFG BasicBlock b = getBasicBlock(ib.getNumber()); // this is really ugly. we pretend that each successively phi in the basic block defs a // particular 'local'. TODO: fix the API in some way so that this is unnecessary. // {What does Julian do for, say, Javascript?} int local = 0; for (SSAPhiInstruction phi : ib.getPhis()) { b.addPhiForLocal(local++, phi); } } }
/** * This is ugly. Clean it up someday. {@link InducedCFG}s carry around phi instructions. add these phi instructions to the * SSABasicBlocks */ private void addPhisFromInducedCFG(InducedCFG cfg) { for (com.ibm.wala.cfg.InducedCFG.BasicBlock ib : cfg) { // we rely on the invariant that basic blocks in this cfg are numbered identically as in the source // InducedCFG BasicBlock b = getBasicBlock(ib.getNumber()); // this is really ugly. we pretend that each successively phi in the basic block defs a // particular 'local'. TODO: fix the API in some way so that this is unnecessary. // {What does Julian do for, say, Javascript?} int local = 0; for (SSAPhiInstruction phi : ib.getPhis()) { b.addPhiForLocal(local++, phi); } } }
ExceptionHandlerBasicBlock newBB = (ExceptionHandlerBasicBlock) cfg.getBasicBlock(bbidx);
ExceptionHandlerBasicBlock newBB = (ExceptionHandlerBasicBlock) cfg.getBasicBlock(bbidx);