edu.cmu.cs.crystal.analysis.alias
Class MayAliasAnalysis
java.lang.Object
edu.cmu.cs.crystal.AbstractCrystalMethodAnalysis
edu.cmu.cs.crystal.analysis.alias.MayAliasAnalysis
- All Implemented Interfaces:
- ICrystalAnalysis
public class MayAliasAnalysis
- extends AbstractCrystalMethodAnalysis
Method Summary |
void |
analyzeMethod(MethodDeclaration d)
Invoked for each method or constructor in the class. |
Set<Variable> |
getAfterAliases(Variable var,
ASTNode node)
Get the aliases of a variable at a particular node. |
Set<ObjectLabel> |
getAfterAliasLabels(ITypeBinding typeBinding,
ASTNode node)
|
Set<ObjectLabel> |
getAfterAliasLabels(String typeName,
ASTNode node)
|
Set<ObjectLabel> |
getAfterAliasLabels(Variable var,
ASTNode node)
|
Set<ObjectLabel> |
getAllLabelsAfter(TACInstruction instr)
|
Set<ObjectLabel> |
getAllLabelsBefore(TACInstruction instr)
|
Set<Variable> |
getBeforeAliases(Variable var,
ASTNode node)
Get the aliases of a variable at a particular node. |
Set<ObjectLabel> |
getBeforeAliasLabels(ITypeBinding typeBinding,
ASTNode node)
Get all the object labels at this node which have the given type, regardless
of who the alias is. |
Set<ObjectLabel> |
getBeforeAliasLabels(String typeName,
ASTNode node)
|
Set<ObjectLabel> |
getBeforeAliasLabels(Variable var,
ASTNode node)
|
TupleLatticeElement<Variable,AliasLE> |
getResultsAfter(TACInstruction instr)
|
TupleLatticeElement<Variable,AliasLE> |
getResultsBefore(TACInstruction instr)
|
Variable |
getThisVar(MethodDeclaration methodDecl)
|
MayAliasAnalysis
public MayAliasAnalysis()
getAfterAliases
public Set<Variable> getAfterAliases(Variable var,
ASTNode node)
- Get the aliases of a variable at a particular node. Returns the aliases
after the given node has been evaluated.
- Parameters:
var
- The variable to look fornode
- The ASTNode that we just evaluated
- Returns:
- A set of possible aliases, including temporary variables.
getBeforeAliases
public Set<Variable> getBeforeAliases(Variable var,
ASTNode node)
- Get the aliases of a variable at a particular node. Returns the aliases
after the given node has been evaluated.
- Parameters:
var
- The variable to look fornode
- The ASTNode that we just evaluated
- Returns:
- A set of possible aliases, including temporary variables.
getBeforeAliasLabels
public Set<ObjectLabel> getBeforeAliasLabels(Variable var,
ASTNode node)
getAfterAliasLabels
public Set<ObjectLabel> getAfterAliasLabels(Variable var,
ASTNode node)
getBeforeAliasLabels
public Set<ObjectLabel> getBeforeAliasLabels(ITypeBinding typeBinding,
ASTNode node)
- Get all the object labels at this node which have the given type, regardless
of who the alias is. This will also include anything which is a subtype of
the given type.
This is expensive.
- Parameters:
typeBinding
- node
-
- Returns:
- A set of all object labels at node which are castable to typeBinding
getBeforeAliasLabels
public Set<ObjectLabel> getBeforeAliasLabels(String typeName,
ASTNode node)
getAfterAliasLabels
public Set<ObjectLabel> getAfterAliasLabels(String typeName,
ASTNode node)
getAfterAliasLabels
public Set<ObjectLabel> getAfterAliasLabels(ITypeBinding typeBinding,
ASTNode node)
analyzeMethod
public void analyzeMethod(MethodDeclaration d)
- Description copied from class:
AbstractCrystalMethodAnalysis
- Invoked for each method or constructor in the class.
- Specified by:
analyzeMethod
in class AbstractCrystalMethodAnalysis
getResultsAfter
public TupleLatticeElement<Variable,AliasLE> getResultsAfter(TACInstruction instr)
getAllLabelsBefore
public Set<ObjectLabel> getAllLabelsBefore(TACInstruction instr)
getAllLabelsAfter
public Set<ObjectLabel> getAllLabelsAfter(TACInstruction instr)
getThisVar
public Variable getThisVar(MethodDeclaration methodDecl)
getResultsBefore
public TupleLatticeElement<Variable,AliasLE> getResultsBefore(TACInstruction instr)