Class 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
    • 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<UnitValueBoxPair> 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<UnitValueBoxPair> 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 uses Local's uses.