|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.analyses.Aliases
public class Aliases
This class computes aliases for a Suite of routines.
$Id: Aliases.java,v 1.78 2007-10-04 19:58:20 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
If simple analysis is selected, we assume that all variables whose addresses have been taken belong to the same alias variable. That is, a variable that points to another variable actually points to any variable that has its address taken. We add an extra pass which finds the variables whose addresses have been taken and creates a special alias variable for them.
If this is not simple analysis, we first create alias variables for each variable in the program. Then, we find the aliases. The alias variables are simply the interface to the alias analysis code. The type of alias analysis must be specified.
Note that we really don't need to create the alias variables during a separate pass. But, it is easier if we create them separately - that way we are able to keep track of them more easily.
Suite
,
AliasAnalysis
Field Summary | |
---|---|
protected Vector<AliasVar> |
aliasVars
A list of the alias variables created. |
protected AliasAnalysis |
analyzer
The object representing the actual alias analyzer. |
static boolean |
classTrace
True if traces are to be performed. |
static java.lang.String |
vvName
Prefix for virtual variable names. |
Constructor Summary | |
---|---|
Aliases(AliasAnalysis analyzer,
Suite suite,
boolean simple)
Create an object for computing aliases in a Suite. |
Method Summary | |
---|---|
void |
addAliasVarToVector(AliasVar av)
Add alias variable created on the fly in FindAliases to the vector. |
void |
addVirtualVariable(ECR ecr,
VirtualVar vv)
Associate a virtual variable with an ECR. |
void |
cleanup()
Remove all the un-needed stuff. |
void |
computeAliases()
The main routine for computing aliases. |
protected void |
computeSizeOfPointsToSet()
Compute the size-points-to statistic. |
protected void |
createAliasVariables()
The first pass of the alias analysis. |
protected void |
findAliases()
The second pass of the alias analysis. |
VirtualVar |
getVirtualVar(ECR ecr)
Return the virtual variable associated with the ECR or create a new virtual var if there isn't one already. |
VirtualVar |
getVirtualVariable(ECR ecr)
Return the virtual variable associated with the ECR or create a new virtual var if there isn't one already. |
AliasVar |
newAliasVariable(Declaration d)
Create an alias variable for a declaration and add an annotation to the declaration. |
protected java.lang.String |
nextVirtualName()
Generate the next virtual variable name. |
void |
printAliasInfo()
Print the aliasing information. |
static int |
sizePointsTo()
Return the size-points-to statistic. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean classTrace
public static final java.lang.String vvName
protected AliasAnalysis analyzer
protected Vector<AliasVar> aliasVars
Constructor Detail |
---|
public Aliases(AliasAnalysis analyzer, Suite suite, boolean simple)
analyzer
- the alias analysis codesuite
- a collection of modules to process (hopefully, a whole program)simple
- true if simple analysis is requestedMethod Detail |
---|
public static int sizePointsTo()
protected java.lang.String nextVirtualName()
public VirtualVar getVirtualVar(ECR ecr)
ecr
- an ECR that represents a virtual variable.
public VirtualVar getVirtualVariable(ECR ecr)
ecr
- an ECR that represents a virtual variable.
public void addVirtualVariable(ECR ecr, VirtualVar vv)
public void computeAliases()
protected void createAliasVariables()
public void cleanup()
protected void findAliases()
public AliasVar newAliasVariable(Declaration d)
d
- the declaration for the variable.
public void addAliasVarToVector(AliasVar av)
protected void computeSizeOfPointsToSet()
public void printAliasInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |