scale.alias
Class AliasAnalysis

java.lang.Object
  extended by scale.alias.AliasAnalysis
Direct Known Subclasses:
ShapiroHorowitz, Steensgaard

public abstract class AliasAnalysis
extends java.lang.Object

A class for computing aliases among variables.

$Id: AliasAnalysis.java,v 1.18 2005-02-07 21:27:10 burrill Exp $

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


Field Summary
static boolean classTrace
          True if traces are to be performed.
protected  boolean trace
           
 
Constructor Summary
AliasAnalysis()
           
 
Method Summary
abstract  void addrAssign(AliasVar lhs, AliasVar addr)
          Compute aliases for the assignment of an address (x = &y).
abstract  AliasVar addVariable(Declaration decl)
          Add a variable into the the analyzer.
abstract  AliasVar addVariable(Declaration decl, AliasVar v)
          Add a variable into the analyzer and use some of the information from an existing alias variable.
abstract  void assignPtr(AliasVar ptr, AliasVar rhs)
          Compute aliases for assigning to a pointer (*x = y).
abstract  void functionCall(AliasVar lhs, AliasVar func, Vector<AliasVar> args)
          Compute aliases caused by a function call.
abstract  void functionDef(AliasVar func, Vector<AliasVar> params, AliasVar retval)
          Compute aliases for the formal parameters and return value of a function definition.
abstract  void heapAssign(AliasVar lhs)
          Compute aliases for assigning dynamically allocated memory.
abstract  boolean isContextSensitive()
          Return true if the analysis is context sensitive.
abstract  boolean isFlowSensitive()
          Return true if the analysis is flow sensitive.
abstract  boolean isInterProcedural()
          Return true if the analysis is interprocedural.
abstract  void opAssign(AliasVar lhs, Vector<AliasVar> opnds)
          Compute alias for an operation (x = op(y1,…,yN)).
abstract  void ptrAssign(AliasVar lhs, AliasVar ptr)
          Compute aliases for a pointer assignment (x = *y).
abstract  void simpleAssign(AliasVar lhs, AliasVar rhs)
          Compute aliases for assignment statement (x = y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classTrace

public static boolean classTrace
True if traces are to be performed.


trace

protected boolean trace
Constructor Detail

AliasAnalysis

public AliasAnalysis()
Method Detail

isFlowSensitive

public abstract boolean isFlowSensitive()
Return true if the analysis is flow sensitive. That is, does the analysis care about statement order.

Returns:
true if the analysis is flow sensitive.

isContextSensitive

public abstract boolean isContextSensitive()
Return true if the analysis is context sensitive. That is, does the analysis care about function call context.

Returns:
true if the analysis is context sensitive.

isInterProcedural

public abstract boolean isInterProcedural()
Return true if the analysis is interprocedural. An analysis that is not interprocedural must make very simplifying assumptions at procedure calls. Note - by definition, a flow and context sensitive analysis is interprocedural.


addVariable

public abstract AliasVar addVariable(Declaration decl)
Add a variable into the the analyzer.

Parameters:
decl - is the name of the variable.
Returns:
the alias variable that represents the varaible.

addVariable

public abstract AliasVar addVariable(Declaration decl,
                                     AliasVar v)
Add a variable into the analyzer and use some of the information from an existing alias variable.

Returns:
the alias variable that represents the varaible.

simpleAssign

public abstract void simpleAssign(AliasVar lhs,
                                  AliasVar rhs)
Compute aliases for assignment statement (x = y).

Parameters:
lhs - the left hand side of the assignment (lvalue).
rhs - the righ hand side of the assignment (rvalue).

addrAssign

public abstract void addrAssign(AliasVar lhs,
                                AliasVar addr)
Compute aliases for the assignment of an address (x = &y).

Parameters:
lhs - is the left hand side of the assignment (lvalue).
addr - is the right hand side of the assignment (the address).

ptrAssign

public abstract void ptrAssign(AliasVar lhs,
                               AliasVar ptr)
Compute aliases for a pointer assignment (x = *y).

Parameters:
lhs - is the left hand side of the assignment.
ptr - is the right hand side of the assignment (the pointer).

opAssign

public abstract void opAssign(AliasVar lhs,
                              Vector<AliasVar> opnds)
Compute alias for an operation (x = op(y1,…,yN)).

Parameters:
lhs - is the left hand side of the assignment.
opnds - is the list of arguments of the operation.

heapAssign

public abstract void heapAssign(AliasVar lhs)
Compute aliases for assigning dynamically allocated memory.

Parameters:
lhs - is the left hand side of the assignment.

assignPtr

public abstract void assignPtr(AliasVar ptr,
                               AliasVar rhs)
Compute aliases for assigning to a pointer (*x = y).

Parameters:
ptr - the pointer representing the left hand side of the assignment.
rhs - the right hand side of the assignment.

functionDef

public abstract void functionDef(AliasVar func,
                                 Vector<AliasVar> params,
                                 AliasVar retval)
Compute aliases for the formal parameters and return value of a function definition.

Parameters:
func - the alias variable representing the function.
params - the alias variables representing the list of parameters.
retval - the alias variables representing the return value.

functionCall

public abstract void functionCall(AliasVar lhs,
                                  AliasVar func,
                                  Vector<AliasVar> args)
Compute aliases caused by a function call.

Parameters:
lhs - the alias variables representing the value returned by the function call.
func - the alias variables representing the function.
args - alias variables representing the arguments.