scale.alias.steensgaard
Class LocationType

java.lang.Object
  extended by scale.alias.steensgaard.AliasType
      extended by scale.alias.steensgaard.LocationType

public class LocationType
extends AliasType

A class which implements the non-standard type describing locations (or pointers to locations). In Steensgaard's paper, he refers to

$Id: LocationType.java,v 1.22 2005-02-07 21:27:11 burrill Exp $

Copyright 2008 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

In Steensgaard's paper, he refers to this as tau types. A location is either bottom (upside down T) or is a value. This type represents a pointer to either another LocationType or to a FunctionType.

In theory, this class contains an ECR representing a ValueType. In practice, instead of maintaining a field with the ValueType, we expose the location and function fields of the ValueType in this class in order to improve efficiency.

See Also:
ValueType, FunctionType

Field Summary
 
Fields inherited from class scale.alias.steensgaard.AliasType
BOT
 
Constructor Summary
LocationType()
          Create a new location type.
LocationType(ECR location, ECR function)
          Create a location type with an initial value.
 
Method Summary
 void cleanup()
          Remove any un-needed stuff after analysis has been performed.
 ECR getFunction()
          Return the type that represents the pointed-to function.
 ECR getLocation()
          Return the type that represents the pointed-to location.
 Vector<ECR> pointsTo()
          Return the list of ECRs that this location type represents.
 int pointsToSize()
          Return the number of ECRs that this location type represents.
 java.lang.String toStringSpecial()
          Return a string representing of a location type.
 void unify(AliasType t)
          Recursively join two location types.
 
Methods inherited from class scale.alias.steensgaard.AliasType
getNodeID, toString, toStringClass, toStringShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationType

public LocationType()
Create a new location type. The initial values of the location and function types are ECRs that represent the BOTTOM type.


LocationType

public LocationType(ECR location,
                    ECR function)
Create a location type with an initial value.

Parameters:
location - the ECR representing the location.
function - the ECR representing the function.
Method Detail

getLocation

public final ECR getLocation()
Return the type that represents the pointed-to location.


getFunction

public final ECR getFunction()
Return the type that represents the pointed-to function.


unify

public final void unify(AliasType t)
Recursively join two location types.

Overrides:
unify in class AliasType
Parameters:
t - a location type.

pointsTo

public Vector<ECR> pointsTo()
Return the list of ECRs that this location type represents.

Overrides:
pointsTo in class AliasType

pointsToSize

public int pointsToSize()
Return the number of ECRs that this location type represents.

Overrides:
pointsToSize in class AliasType

toStringSpecial

public java.lang.String toStringSpecial()
Return a string representing of a location type.

Overrides:
toStringSpecial in class AliasType

cleanup

public void cleanup()
Remove any un-needed stuff after analysis has been performed.

Overrides:
cleanup in class AliasType