public class SSACFG.BasicBlock extends java.lang.Object implements ISSABasicBlock
| Constructor and Description |
|---|
BasicBlock(int number) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPhiForLocal(int n,
SSAPhiInstruction phi) |
void |
addPhiForStackSlot(int slot,
SSAPhiInstruction phi) |
void |
addPiForRefAndPath(int n,
java.lang.Object path,
SSAPiInstruction pi) |
boolean |
equals(java.lang.Object arg0) |
java.util.List<SSAInstruction> |
getAllInstructions()
TODO: make this more efficient if needed
|
java.util.Iterator<TypeReference> |
getCaughtExceptionTypes()
The
SSACFG.ExceptionHandlerBasicBlock subclass will override this. |
int |
getFirstInstructionIndex()
Method getFirstInstructionIndex.
|
int |
getGraphNodeId() |
SSAInstruction |
getLastInstruction() |
int |
getLastInstructionIndex()
Get the index of the last instruction in the basic block.
|
IMethod |
getMethod() |
int |
getNumber()
Each basic block should have a unique number in its cfg
|
SSAPhiInstruction |
getPhiForLocal(int n)
This method is used during SSA construction.
|
SSAPhiInstruction |
getPhiForStackSlot(int slot)
This method is used during SSA construction.
|
SSAPiInstruction |
getPiForRefAndPath(int n,
java.lang.Object path) |
int |
hashCode() |
boolean |
hasPhi() |
boolean |
isCatchBlock()
Is this block marked as a catch block?
|
boolean |
isEntryBlock()
Does this block represent the unique entry to a
ControlFlowGraph |
boolean |
isExitBlock()
Does this block represent the unique exit from a
ControlFlowGraph? |
java.util.Iterator<SSAInstruction> |
iterateNormalInstructions() |
java.util.Iterator<SSAPhiInstruction> |
iteratePhis() |
java.util.Iterator<SSAPiInstruction> |
iteratePis() |
java.util.Iterator<SSAInstruction> |
iterator() |
void |
removePhis(java.util.Set<SSAPhiInstruction> toRemove)
Remove any phis in the set.
|
void |
setGraphNodeId(int number) |
java.lang.String |
toString() |
public int getNumber()
IBasicBlockgetNumber in interface IBasicBlock<SSAInstruction>public int getFirstInstructionIndex()
getFirstInstructionIndex in interface IBasicBlock<SSAInstruction>public boolean isCatchBlock()
isCatchBlock in interface IBasicBlock<SSAInstruction>isCatchBlock in interface ISSABasicBlockpublic int getLastInstructionIndex()
IBasicBlockIf the result is < 0, the block has no instructions
getLastInstructionIndex in interface IBasicBlock<SSAInstruction>public java.util.Iterator<SSAPhiInstruction> iteratePhis()
iteratePhis in interface ISSABasicBlockpublic SSAPhiInstruction getPhiForStackSlot(int slot)
public SSAPhiInstruction getPhiForLocal(int n)
public void addPhiForStackSlot(int slot,
SSAPhiInstruction phi)
public void addPhiForLocal(int n,
SSAPhiInstruction phi)
public void removePhis(java.util.Set<SSAPhiInstruction> toRemove)
public SSAPiInstruction getPiForRefAndPath(int n, java.lang.Object path)
public void addPiForRefAndPath(int n,
java.lang.Object path,
SSAPiInstruction pi)
n - can be the val in the pi instructionpath - can be the successor block in the pi instructionpublic java.util.Iterator<SSAPiInstruction> iteratePis()
iteratePis in interface ISSABasicBlockpublic java.util.Iterator<SSAInstruction> iterateNormalInstructions()
public java.util.List<SSAInstruction> getAllInstructions()
public java.util.Iterator<SSAInstruction> iterator()
iterator in interface java.lang.Iterable<SSAInstruction>public boolean hasPhi()
public int getGraphNodeId()
getGraphNodeId in interface com.ibm.wala.util.graph.INodeWithNumberpublic void setGraphNodeId(int number)
setGraphNodeId in interface com.ibm.wala.util.graph.INodeWithNumberpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object arg0)
equals in class java.lang.Objectpublic IMethod getMethod()
getMethod in interface IBasicBlock<SSAInstruction>public int hashCode()
hashCode in class java.lang.Objectpublic boolean isExitBlock()
ISSABasicBlockControlFlowGraph?isExitBlock in interface IBasicBlock<SSAInstruction>isExitBlock in interface ISSABasicBlockpublic boolean isEntryBlock()
ISSABasicBlockControlFlowGraphisEntryBlock in interface IBasicBlock<SSAInstruction>isEntryBlock in interface ISSABasicBlockpublic SSAInstruction getLastInstruction()
getLastInstruction in interface ISSABasicBlockpublic java.util.Iterator<TypeReference> getCaughtExceptionTypes()
SSACFG.ExceptionHandlerBasicBlock subclass will override this.getCaughtExceptionTypes in interface ISSABasicBlock