public class BasicBlock
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
BasicBlock(Function function)
Constructs a new initially empty block of nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(AbstractNode n)
Adds a node to this block.
|
void |
addSuccessor(BasicBlock succ)
Adds a successor.
|
boolean |
canThrowExceptions()
Returns true if this block contains a node that may throw exceptions.
|
void |
check(BasicBlock entry,
BasicBlock ordinary_exit,
BasicBlock exceptional_exit,
java.util.Set<java.lang.Integer> seen_blocks,
java.util.Set<java.lang.Integer> seen_nodes)
Perform a consistency check of the basic block.
|
BasicBlock |
getEntryBlock()
Returns the entry block
|
BasicBlock |
getEntryPredecessorBlock()
Returns the entry_predecessor_block, or null if not set.
|
BasicBlock |
getExceptionHandler()
Returns the exception handler block, or null if not set.
|
AbstractNode |
getFirstNode()
Returns the first node.
|
Function |
getFunction()
Returns the function containing this block.
|
int |
getIndex()
Returns the block index, or -1 if not set.
|
AbstractNode |
getLastNode()
Returns the last node.
|
java.util.List<AbstractNode> |
getNodes()
Returns the sequence of nodes.
|
int |
getOrder()
Returns the block order.
|
BasicBlock |
getSingleSuccessor()
Returns the single successor block.
|
SourceLocation |
getSourceLocation()
Returns the source location for the first node in the basic block.
|
java.util.Collection<BasicBlock> |
getSuccessors()
Returns the successors of this block.
|
boolean |
isEmpty()
Returns true if there are no nodes in the basic block.
|
boolean |
isEntry()
Checks whether this is a function entry block.
|
void |
removeSuccessor(BasicBlock succ)
Remove a successor.
|
void |
setEntryBlock(BasicBlock entry_block)
Sets the entry block
|
void |
setEntryPredecessorBlock(BasicBlock entry_predecessor_block)
Sets the entry_predecessor_block
|
void |
setExceptionHandler(BasicBlock exception_handler)
Sets the exception handler block.
|
void |
setIndex(int index)
Sets the block index.
|
(package private) void |
setOrder(int order)
Sets the block order.
|
void |
toDot(java.io.PrintWriter pw,
boolean standalone)
Produces a Graphviz dot representation of this block.
|
java.lang.String |
toString()
Returns a string description of this block.
|
public BasicBlock(Function function)
function
- The function this block belongs to.public void addNode(AbstractNode n)
public void addSuccessor(BasicBlock succ)
public boolean canThrowExceptions()
public void check(BasicBlock entry, BasicBlock ordinary_exit, BasicBlock exceptional_exit, java.util.Set<java.lang.Integer> seen_blocks, java.util.Set<java.lang.Integer> seen_nodes)
public BasicBlock getEntryBlock()
public BasicBlock getEntryPredecessorBlock()
public BasicBlock getExceptionHandler()
public AbstractNode getFirstNode()
public Function getFunction()
public int getIndex()
public AbstractNode getLastNode()
public java.util.List<AbstractNode> getNodes()
public int getOrder()
public BasicBlock getSingleSuccessor()
AnalysisException
- if not exactly one successorpublic SourceLocation getSourceLocation()
public java.util.Collection<BasicBlock> getSuccessors()
public boolean isEmpty()
public boolean isEntry()
public void removeSuccessor(BasicBlock succ)
public void setEntryBlock(BasicBlock entry_block)
public void setEntryPredecessorBlock(BasicBlock entry_predecessor_block)
public void setExceptionHandler(BasicBlock exception_handler)
public void setIndex(int index)
void setOrder(int order)
public void toDot(java.io.PrintWriter pw, boolean standalone)
pw
- Receiver of the dot representation of this basic block.standalone
- Indicates that this is a complete graph that should be closed.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2019 Aarhus University