|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.alias.AliasAnalysis scale.alias.shapirohorowitz.ShapiroHorowitz
public class ShapiroHorowitz
A class which implements extension to Bjarne Steensgaard's alias analysis algorithm.
$Id: ShapiroHorowitz.java,v 1.19 2005-06-15 04:17:05 asmith Exp $
Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
The algorithm performs interprocedural flow-insensitive points-to analysis. The important features of the algorithm are:
Field Summary |
---|
Fields inherited from class scale.alias.AliasAnalysis |
---|
classTrace, trace |
Constructor Summary | |
---|---|
ShapiroHorowitz(boolean interprocedural,
int numberCategories)
Create an instance of the Shapiro-Horwitz alias analysis algorithm and indicate if it operates on the whole program. |
|
ShapiroHorowitz(int numberCategories)
Create an instance of the Shapiro-Horwitz alias analysis algorithm. |
Method Summary | |
---|---|
void |
addrAssign(AliasVar lhs,
AliasVar addr)
Inference rule for the assignment of an address (x = &y). |
AliasVar |
addVariable(Declaration decl)
Add a variable that needs to be processed by the algorithm. |
AliasVar |
addVariable(Declaration decl,
AliasVar v)
Add a variable into the analyzer and indicate the variable is in the same alias group as another variable. |
void |
assignPtr(AliasVar ptr,
AliasVar rhs)
Inference rule for assigning to a pointer (*x = y). |
void |
cleanup()
Remove all the un-needed stuff. |
void |
functionCall(AliasVar lhs,
AliasVar func,
Vector<AliasVar> args)
Inference rule for a function call assignment. |
void |
functionDef(AliasVar func,
Vector<AliasVar> params,
AliasVar retval)
Inference rule for a function definition. |
void |
heapAssign(AliasVar lhs)
Inference rule for assigning dynamically allocated memory. |
boolean |
isContextSensitive()
Return false because Shapiro-Horwitz's algorithm is not context sensitive. |
boolean |
isFlowSensitive()
Return false because Shapiro-Horwitz's algorithm is not flow sensitive. |
boolean |
isInterProcedural()
Return true if the analysis is interprocedural. |
void |
opAssign(AliasVar lhs,
Vector<AliasVar> opnds)
Inference rule for an operation (x = op(y1,…,yN)) . |
void |
ptrAssign(AliasVar lhs,
AliasVar ptr)
Inference rule for a pointer assignment (x = *y |
void |
simpleAssign(AliasVar lhs,
AliasVar rhs)
Inference rules for simple assignment (x = y). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShapiroHorowitz(int numberCategories)
public ShapiroHorowitz(boolean interprocedural, int numberCategories)
interprocedural
- set to true if the analysis should be interproceduralMethod Detail |
---|
public boolean isFlowSensitive()
isFlowSensitive
in class AliasAnalysis
public boolean isContextSensitive()
isContextSensitive
in class AliasAnalysis
public boolean isInterProcedural()
isInterProcedural
in class AliasAnalysis
public AliasVar addVariable(Declaration decl)
addVariable
in class AliasAnalysis
decl
- is the name of the variable.
public AliasVar addVariable(Declaration decl, AliasVar v)
addVariable
in class AliasAnalysis
public void simpleAssign(AliasVar lhs, AliasVar rhs)
simpleAssign
in class AliasAnalysis
lhs
- the left hand side of the assignment.rhs
- the right hand side of the assignment.public void addrAssign(AliasVar lhs, AliasVar addr)
addrAssign
in class AliasAnalysis
lhs
- the left hand side of the assignment.addr
- the right hand side of the assignment (the address).public void ptrAssign(AliasVar lhs, AliasVar ptr)
ptrAssign
in class AliasAnalysis
lhs
- the left hand side of the assignment.ptr
- the right hand side of the assignment (the pointer).public void opAssign(AliasVar lhs, Vector<AliasVar> opnds)
(x = op(y1,…,yN))
.
opAssign
in class AliasAnalysis
lhs
- the left hand side of the assignment.opnds
- the list of arguments of the operation.public void heapAssign(AliasVar lhs)
heapAssign
in class AliasAnalysis
lhs
- the left hand side of the assignment.public void assignPtr(AliasVar ptr, AliasVar rhs)
assignPtr
in class AliasAnalysis
ptr
- the pointer representing the left hand side of the assignment.rhs
- the right hand side of the assignment.public void functionDef(AliasVar func, Vector<AliasVar> params, AliasVar retval)
functionDef
in class AliasAnalysis
func
- the alias variable representing the function.params
- the alias variables representing the list of parameters.retval
- the alias variables representing the return value.public void functionCall(AliasVar lhs, AliasVar func, Vector<AliasVar> args)
functionCall
in class AliasAnalysis
lhs
- the alias variables representing the value returned
by the function call (is null if there function returns nothing)func
- the alias variables representing the function.args
- alias variables representing the arguments.public void cleanup()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |