soot.shimple.toolkits.scalar
Class ShimpleLocalUses

java.lang.Object
  extended by soot.shimple.toolkits.scalar.ShimpleLocalUses
All Implemented Interfaces:
LocalUses

public class ShimpleLocalUses
extends Object
implements LocalUses

This class implements the LocalUses interface for Shimple. ShimpleLocalUses can be used in conjunction with SimpleLocalDefs to provide Definition/Use and Use/Definition chains in SSA.

In addition to the interface required by LocalUses, ShimpleLocalUses also provides a method for obtaining the list of uses given only the Local. Furthermore, unlike SimpleLocalUses, a LocalDefs object is not required when constructing ShimpleLocalUses.

Author:
Navindra Umanee
See Also:
ShimpleLocalDefs, SimpleLocalDefs, SimpleLocalUses

Field Summary
protected  Map<Local,ArrayList> localToUses
           
 
Constructor Summary
ShimpleLocalUses(ShimpleBody sb)
          Build a LocalUses interface from a ShimpleBody.
 
Method Summary
 List getUsesOf(Local local)
          Returns all the uses of the given Local as a list of UnitValueBoxPairs, each containing a Unit that uses the local and the corresponding ValueBox containing the Local.
 List getUsesOf(Unit unit)
          If a Local is defined in the Unit, returns all the uses of that Local as a list of UnitValueBoxPairs, each containing a Unit that uses the local and the corresponding ValueBox containing the Local.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localToUses

protected Map<Local,ArrayList> localToUses
Constructor Detail

ShimpleLocalUses

public ShimpleLocalUses(ShimpleBody sb)
Build a LocalUses interface from a ShimpleBody. Proper SSA form is required, otherwise correct behaviour is not guaranteed.

Method Detail

getUsesOf

public List getUsesOf(Local local)
Returns all the uses of the given Local as a list of UnitValueBoxPairs, each containing a Unit that uses the local and the corresponding ValueBox containing the Local.

This method is currently not required by the LocalUses interface.


getUsesOf

public List getUsesOf(Unit unit)
If a Local is defined in the Unit, returns all the uses of that Local as a list of UnitValueBoxPairs, each containing a Unit that uses the local and the corresponding ValueBox containing the Local.

Specified by:
getUsesOf in interface LocalUses
Parameters:
unit - the unit we wish to query for the use of the Local it defines.
Returns:
a list of the Local's uses.