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

BlockMap Class Reference

Inheritance diagram for BlockMap:
[legend]
Collaboration diagram for BlockMap:
[legend]
List of all members.

Public Methods

 BlockMap ()
 BlockMap (SootMethod m, int flags)
void addLocal (Local l)
ca mcgill sable util List collapse ()
SootMethod createMethod (String name, ca.mcgill.sable.util.List params, Type ret)
List getFinalBlocks ()
Index getInit ()
JimpleBody getListBody ()
Local getLocal (String name, Type t)
ca mcgill sable util List getLocals ()
Map getStmtToIndex ()
void setInit (Index i)
void setLocals (ca.mcgill.sable.util.List l)
String toString ()

Static Public Attributes

final int BLOCKLEVEL = 0
final int STMTLEVEL = 1
final int HAMMOCK = 2
String returnVariable = "$RESULT$"

Protected Methods

void compress ()
void setJumps ()
void setupBlockLevel (boolean hammock)
void setupStmtLevel (boolean hammock)

Protected Attributes

Index initBlock
List finalBlocks
Map stmtToIndex
JimpleBody listBody
ca mcgill sable util List locals
StmtList stmtList
SootMethod method
Map nameToLocal

Detailed Description

A blockmap structure. It holds the information for a method that makes a control flow graph. This holds the data to lookup a block using the index. It also keeps the local variables and other information needed to create a new method from a block map.

Author:
Shawn Laubach
Version:
0.1

Definition at line 51 of file BlockMap.java.


Constructor & Destructor Documentation

BlockMap::BlockMap   [inline]
 

Constructs a new empty blockmap.

Definition at line 86 of file BlockMap.java.

BlockMap::BlockMap SootMethod   m,
int   flags
[inline]
 

Constructs a new blockmap from a method with the flags.

Parameters:
m   the method to create the block map from.
flags   these are the flags that specify statement level, block level, and hammock configuration.

Definition at line 100 of file BlockMap.java.


Member Function Documentation

void BlockMap::addLocal Local   l [inline]
 

Adds a local to the local list.

Parameters:
l   local to add.

Definition at line 119 of file BlockMap.java.

ca mcgill sable util List BlockMap::collapse   [inline]
 

Collapses all the block into a list of statements. It merges blocks that end with a goto to another block that only has one entry point. It then puts goto's and other structures as necessesary to ensure correct list construction.

Returns:
A list of statements made form the blockmap.

Definition at line 131 of file BlockMap.java.

SootMethod BlockMap::createMethod String   name,
ca.mcgill.sable.util.List   params,
Type   ret
[inline]
 

Creates a method from the blockmap. It takes the name, parameters, and the return type and creates the methods.

Parameters:
name   the name of the method.
params   a list of parameters like what soot would take.
ret   the return type of the method.
Returns:
The method that can be created from the block map.

Definition at line 228 of file BlockMap.java.

List BlockMap::getFinalBlocks   [inline]
 

Return the list of final blocks.

Returns:
List of final blocks.

Definition at line 249 of file BlockMap.java.

Index BlockMap::getInit   [inline]
 

Get the initial index.

Definition at line 256 of file BlockMap.java.

JimpleBody BlockMap::getListBody   [inline]
 

Return the list body made from the method.

Definition at line 263 of file BlockMap.java.

Local BlockMap::getLocal String   name,
Type   t
[inline]
 

Get a reference to a local. If it is not there, it creates and adds it.

Parameters:
name   the name of the local.

Definition at line 273 of file BlockMap.java.

ca mcgill sable util List BlockMap::getLocals   [inline]
 

Get the list of locals declared for the block map.

Definition at line 298 of file BlockMap.java.

Map BlockMap::getStmtToIndex   [inline]
 

Returns the statement to index map.

Definition at line 305 of file BlockMap.java.

void BlockMap::setInit Index   i [inline]
 

Set the initial index of a block map.

Definition at line 312 of file BlockMap.java.

void BlockMap::setJumps   [inline, protected]
 

Set all the jumps so that they point to the correct statement. This method is used before any outside analysis because the statements jumps point to can be null because they can be unknown during the creation of a blockmap. This sets all the statements to the correct points.

Definition at line 323 of file BlockMap.java.

void BlockMap::setLocals ca.mcgill.sable.util.List   l [inline]
 

Set the list of locals.

Definition at line 377 of file BlockMap.java.


Member Data Documentation

final int BlockMap::BLOCKLEVEL = 0 [static]
 

Option to set block level structure in the basic blocks.

Definition at line 55 of file BlockMap.java.

final int BlockMap::HAMMOCK = 2 [static]
 

Option to set a hammock CFG when there is only one entrance and one exit.

Definition at line 66 of file BlockMap.java.

final int BlockMap::STMTLEVEL = 1 [static]
 

Option to set statement level structures in the basic blocks.

Definition at line 60 of file BlockMap.java.

String BlockMap::returnVariable = "$RESULT$" [static]
 

String name for the return variable used in hammock mode.

Definition at line 71 of file BlockMap.java.


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