Package com.tonic.analysis.cpg.node
Class BlockNode
- java.lang.Object
-
- com.tonic.analysis.cpg.node.CPGNode
-
- com.tonic.analysis.cpg.node.BlockNode
-
public class BlockNode extends CPGNode
CPG node wrapping a basic block of SSA IR.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IRBlockgetBlock()intgetBlockId()intgetInstructionCount()StringgetLabel()<T> TgetUnderlying()booleanhasTerminator()booleanisEntry()booleanisEntryBlock()booleanisExitBlock()StringtoString()-
Methods inherited from class com.tonic.analysis.cpg.node.CPGNode
addIncomingEdge, addOutgoingEdge, astChildren, astParent, cfgPredecessors, cfgSuccessors, controlDependencies, dataDependencies, equals, getEdges, getId, getIncomingEdges, getIncomingEdges, getInDegree, getNodeType, getOutDegree, getOutgoingEdges, getOutgoingEdges, getProperties, getProperty, getTaintLabel, hashCode, hasProperty, isTainted, removeIncomingEdge, removeOutgoingEdge, removeProperty, setProperty, setTainted, setTaintLabel
-
-
-
-
Constructor Detail
-
BlockNode
public BlockNode(long id, IRBlock block)Creates a node for a basic block.- Parameters:
id- the unique node idblock- the wrapped IR block
-
-
Method Detail
-
getBlock
public IRBlock getBlock()
- Returns:
- the block
-
getBlockId
public int getBlockId()
- Returns:
- the block id
-
getLabel
public String getLabel()
-
getUnderlying
public <T> T getUnderlying()
- Specified by:
getUnderlyingin classCPGNode- Type Parameters:
T- the expected underlying type- Returns:
- the wrapped IR or analysis object
-
isEntry
public boolean isEntry()
- Returns:
- whether the block is the method entry block
-
isEntryBlock
public boolean isEntryBlock()
- Returns:
- whether the block is the method entry block
-
isExitBlock
public boolean isExitBlock()
- Returns:
- whether the block is an exit block
-
hasTerminator
public boolean hasTerminator()
- Returns:
- whether the block ends in a terminator instruction
-
getInstructionCount
public int getInstructionCount()
- Returns:
- the number of instructions in the block, phis included
-
-