Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

BasicBlock Class Reference

List of all members.

Public Methods

 BasicBlock (Instruction insts)
boolean equals (BasicBlock b)
int hashCode ()
String toString ()
 BasicBlock (Index n)
void addPreds (Index pred)
void addStmt (Stmt stmt)
void addSuccs (Index succ)
void changePreds (Index from, List to)
void changeSuccs (Index from, Index to)
ca mcgill sable util List get ()
Stmt get (int i)
List getGoOn ()
Index getIndex ()
List getPreds ()
Index getPreds (int i)
List getSuccs ()
Index getSuccs (int i)
void setGoOn (List newGoOn)
int size ()
String toString ()

Public Attributes

int size
Instruction head
Instruction tail
Vector succ
Vector pred
boolean inq
boolean beginException
boolean beginCode
BasicBlock next
long id

Protected Attributes

Index name
List preds
ca mcgill sable util List stmts
List succs
List goOn

Private Methods

ca mcgill sable soot jimple
Stmt 
getHeadJStmt ()
ca mcgill sable soot jimple
Stmt 
getTailJStmt ()
int wideIndex (short b)

Private Attributes

boolean done
short wide
ca mcgill sable soot jimple
Stmt 
stmt
ca mcgill sable util List statements
ca mcgill sable util Set addressesToFixup = new ca.mcgill.sable.util.VectorSet()

Static Private Attributes

long ids

Detailed Description

Represents one basic block in a control flow graph.
See also:
CFG , ClassFile::parse
Author:
Clark Verbrugge

Definition at line 117 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.


Constructor & Destructor Documentation

BasicBlock::BasicBlock Index   n [inline]
 

Constructs a new basic block with index n.

Parameters:
n   the name of the basic block.

Definition at line 75 of file edu/ksu/cis/bandera/prog/BasicBlock.java.


Member Function Documentation

void BasicBlock::addPreds Index   pred [inline]
 

As a predecessor to the block.

Parameters:
pred   the name of the predecessor.

Definition at line 86 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Referenced by BlockMap::setJumps().

void BasicBlock::addStmt Stmt   stmt [inline]
 

Adds a statement to the block.

Parameters:
stmt   the statement to add.

Definition at line 96 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

void BasicBlock::addSuccs Index   succ [inline]
 

Adds a successor to the block.

Parameters:
succ   the successor name.

Definition at line 105 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

void BasicBlock::changePreds Index   from,
List   to
[inline]
 

Changes the name of an index to another name in the predecessor.

Parameters:
from   the index to change.
to   the index to change to.

Definition at line 115 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

void BasicBlock::changeSuccs Index   from,
Index   to
[inline]
 

Changes the name of an index to another name in the successors.

Parameters:
from   the index to change.
to   the index to change to.

Definition at line 126 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

boolean BasicBlock::equals BasicBlock   b [inline]
 

True if this block represents the same piece of code. Basically compares labels of the head instructions.

Parameters:
b   block to compare against.
Returns:
true if they do, false if they don't.

Definition at line 190 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

Stmt BasicBlock::get int   i [inline]
 

Get the ith statement from the list.

Parameters:
i   the position of the statement to get.
Returns:
The statement at the ith position or null if the position is out of the range of statements.

Definition at line 146 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

ca mcgill sable util List BasicBlock::get   [inline]
 

Gets the list of statements.

Returns:
The list of statements.

Definition at line 135 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Referenced by BlockMap::collapse(), and BlockMap::setJumps().

List BasicBlock::getGoOn   [inline]
 

Insert the method's description here. Creation date: (4/13/00 2:25:06 PM)

Returns:
ca.mcgill.sable.util.List

Definition at line 158 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Referenced by BlockMap::setJumps().

Index BasicBlock::getIndex   [inline]
 

Gets the index of a basic block.

Returns:
The index of the block.

Definition at line 166 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Referenced by BlockMap::collapse(), and BlockMap::setJumps().

Index BasicBlock::getPreds int   i [inline]
 

Gets the ith predecessor.

Parameters:
i   the position of the predecessor.
Returns:
The index at position i unless i is out of bounds and then null.

Definition at line 187 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

List BasicBlock::getPreds   [inline]
 

Gets the list of predecessors.

Returns:
The list of predecessors.

Definition at line 175 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Index BasicBlock::getSuccs int   i [inline]
 

Gets the ith successor.

Parameters:
i   the position of the successor.
Returns:
The index at position i unless i is out of bounds and then null.

Definition at line 211 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

List BasicBlock::getSuccs   [inline]
 

Gets the list of successors.

Returns:
The list of successors.

Definition at line 199 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Referenced by BlockMap::collapse(), and BlockMap::setJumps().

int BasicBlock::hashCode   [inline]
 

Computes a hash code for this block from the label of the first instruction in its contents.

Returns:
the hash code.
See also:
Instruction::label

Definition at line 207 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

void BasicBlock::setGoOn List   newGoOn [inline]
 

Insert the method's description here. Creation date: (4/13/00 2:25:06 PM)

Parameters:
newGoOn   ca.mcgill.sable.util.List

Definition at line 223 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

int BasicBlock::size   [inline]
 

Returns the number of statements.

Returns:
The number of statements.

Definition at line 231 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

String BasicBlock::toString   [inline]
 

For printing the string "BB: " + id.

Definition at line 212 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.


Member Data Documentation

boolean BasicBlock::beginCode
 

Flag for whether starting main code block or not.

Definition at line 145 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

boolean BasicBlock::beginException
 

Flag for whether starting an exception or not.

Definition at line 143 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

boolean BasicBlock::done [private]
 

Flag for semantic stack analysis fixup pass.

See also:
CFG::jimplify

Definition at line 150 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

Instruction BasicBlock::head
 

Head of the list of instructions.

Definition at line 121 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

long BasicBlock::id
 

Unique (among basic blocks) id.

Definition at line 155 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

Index BasicBlock::name [protected]
 

Name of the block.

Definition at line 53 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

BasicBlock BasicBlock::next
 

Next BasicBlock in the CFG, in the parse order.

Definition at line 153 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

Vector BasicBlock::pred
 

Vector of successor BasicBlocks.

See also:
java.util.Vector

Definition at line 139 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

List BasicBlock::preds [protected]
 

List of predecessors.

Definition at line 58 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

int BasicBlock::size
 

Number of instructions in this block.

Definition at line 119 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

ca mcgill sable soot jimple Stmt BasicBlock::stmt [private]
 

Constructs a BasicBlock consisting of the given list of Instructions.

Parameters:
insts   list of instructions composing this basic block.

Definition at line 165 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

ca mcgill sable util List BasicBlock::stmts [protected]
 

List of statements in the block.

Definition at line 63 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Vector BasicBlock::succ
 

Vector of predecessor BasicBlocks.

See also:
java.util.Vector

Definition at line 135 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.

List BasicBlock::succs [protected]
 

List of successors in the block.

Definition at line 68 of file edu/ksu/cis/bandera/prog/BasicBlock.java.

Instruction BasicBlock::tail
 

Tail of the list of instructions.

Normally, the last instruction will have a next pointer with value null. After a Instruction sequences are reconstructed though, the instruction lists are rejoined in order, and so the tail instruction will not have a null next pointer.

See also:
CFG::reconstructInstructions

Definition at line 131 of file ca/mcgill/sable/soot/coffi/BasicBlock.java.


The documentation for this class was generated from the following files:
Generated at Thu Feb 7 07:05:11 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001