|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Compiler.Quad.BasicBlock
public class BasicBlock
Represents a basic block in the quad intermediate representation. Basic blocks are single-entry regions, but not necessarily single-exit regions due to the fact that control flow may exit a basic block early due to a run time exception. That is to say, a potential exception point does not end a basic block. Each basic block contains a list of quads, a list of predecessors, a list of successors, and a list of exception handlers. It also has an id number that is unique within its control flow graph, and some flags. You should never create a basic block directly. You should create one via a ControlFlowGraph so that the id number is correct.
Quad
,
ControlFlowGraph
,
ExceptionHandlerList
Method Summary | |
---|---|
void |
addAtEnd(ControlFlowGraph ir,
Quad c)
|
void |
addPredecessor(BasicBlock b)
Add a predecessor basic block to this basic block. |
void |
addQuad(int index,
Quad q)
Add a quad to this basic block at the given location. |
void |
addSuccessor(BasicBlock b)
Add a successor basic block to this basic block. |
void |
appendExceptionHandlerList(ExceptionHandlerList list)
Appends the list of exception handlers to the current list of exception handlers. |
void |
appendQuad(Quad q)
Append a quad to the end of this basic block. |
void |
appendQuadBeforeBranchOrPEI(Quad c)
|
ListIterator.Quad |
backwardIterator()
Returns an iterator over the quads in this basic block in backward order. |
void |
backwardVisitQuads(QuadVisitor qv)
Visit all of the quads in this basic block in backward order with the given quad visitor. |
boolean |
endsInRet()
|
String |
fullDump()
Returns a String describing the name, predecessor, successor, exception handlers, and quads of this basic block. |
List.BasicBlock |
getExceptionHandlerEntries()
|
ExceptionHandlerList |
getExceptionHandlers()
Returns the list of exception handlers that guard this basic block. |
BasicBlock |
getFallthroughPredecessor()
Returns the fallthrough predecessor to this basic block, if it exists. |
BasicBlock |
getFallthroughSuccessor()
Returns the fallthrough successor to this basic block, if it exists. |
int |
getID()
Returns the unique id number for this basic block. |
Quad |
getLastQuad()
|
int |
getNumberOfPredecessors()
|
int |
getNumberOfSuccessors()
|
List.BasicBlock |
getPredecessors()
Returns an list of the predecessors of this basic block. |
Quad |
getQuad(int i)
|
int |
getQuadIndex(Quad q)
|
List.BasicBlock |
getSuccessors()
Returns a list of the successors of this basic block. |
boolean |
isEntry()
Returns true if this is the entry basic block. |
boolean |
isExceptionHandlerEntry()
Returns true if this basic block has been marked as an exception handler entry point. |
boolean |
isExit()
Returns true if this is the exit basic block. |
boolean |
isJSREntry()
Returns true if this basic block has been marked as a JSR entry. |
ListIterator.Quad |
iterator()
Returns an iterator over the quads in this basic block in forward order. |
void |
removeAllPredecessors()
|
void |
removeAllQuads()
|
void |
removeAllSuccessors()
|
boolean |
removePredecessor(BasicBlock bb)
|
void |
removePredecessor(int i)
|
boolean |
removePredecessors(Collection bb)
|
Quad |
removeQuad(int i)
|
boolean |
removeQuad(Quad q)
|
boolean |
removeSuccessor(BasicBlock bb)
|
void |
removeSuccessor(int i)
|
void |
replaceQuad(int pos,
Quad q)
Replace the quad at position pos. |
void |
setExceptionHandlerEntry()
Marks this basic block as an exception handler entry point. |
void |
setJSREntry()
Marks this basic block as a JSR entry. |
int |
size()
Returns the number of quads in this basic block. |
String |
toString()
Returns the name of this basic block. |
void |
visitQuads(QuadVisitor qv)
Visit all of the quads in this basic block in forward order with the given quad visitor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean isEntry()
public boolean isExit()
public ListIterator.Quad iterator()
public ListIterator.Quad backwardIterator()
public void visitQuads(QuadVisitor qv)
qv
- QuadVisitor to visit the quads with.QuadVisitor
public void backwardVisitQuads(QuadVisitor qv)
qv
- QuadVisitor to visit the quads with.QuadVisitor
public int size()
public Quad getQuad(int i)
public Quad getLastQuad()
public int getQuadIndex(Quad q)
public Quad removeQuad(int i)
public boolean removeQuad(Quad q)
public void removeAllQuads()
public void addQuad(int index, Quad q)
index
- the index to add the quadq
- quad to addpublic void appendQuad(Quad q)
q
- quad to addpublic void replaceQuad(int pos, Quad q)
public void addPredecessor(BasicBlock b)
b
- basic block to add as a predecessorpublic void addSuccessor(BasicBlock b)
b
- basic block to add as a successorpublic boolean removePredecessor(BasicBlock bb)
public void removePredecessor(int i)
public boolean removePredecessors(Collection bb)
public boolean removeSuccessor(BasicBlock bb)
public void removeSuccessor(int i)
public void removeAllPredecessors()
public void removeAllSuccessors()
public int getNumberOfSuccessors()
public int getNumberOfPredecessors()
public BasicBlock getFallthroughSuccessor()
public BasicBlock getFallthroughPredecessor()
public List.BasicBlock getSuccessors()
public List.BasicBlock getPredecessors()
public ExceptionHandlerList getExceptionHandlers()
ExceptionHandlerList
public void appendExceptionHandlerList(ExceptionHandlerList list)
public int getID()
public List.BasicBlock getExceptionHandlerEntries()
public boolean isExceptionHandlerEntry()
public void setExceptionHandlerEntry()
public boolean isJSREntry()
public void setJSREntry()
public boolean endsInRet()
public void appendQuadBeforeBranchOrPEI(Quad c)
public String toString()
toString
in class Object
public void addAtEnd(ControlFlowGraph ir, Quad c)
public String fullDump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |