|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.pred.Supertype scale.score.pred.TraceChords scale.score.analyses.FindAliases
public class FindAliases
This class visits nodes in order to compute aliases.
$Id: FindAliases.java,v 1.84 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.
We visit expression nodes and compute aliases when for each assignment operation. We expect that this predicate is used by the TraceChords predicate (which is responsible for idenitifing all expression nodes in a graph). The user may also provide a different technique for traversing the graph in order to find expression nodes.
We traversing the tree we sometimes need to create new temporary alias variables. For example, this happens when we compute some value that is not assigned to a temporary or real variable. We add the temporary alias variable as an annotation (AliasAnnote). When we are done using the temporary, we need to explictily remove it. At some point, we need to improve/fix the annotation code or use a different technique for saving the temporary alias variables.
The code to find the aliases depends on the structure of the Scribble tree. Any major changes to the structure must be reflected in this code.
ExprChord
Field Summary | |
---|---|
static boolean |
classTrace
True if traces are to be performed. |
protected boolean |
trace
Set true to trace operation. |
Fields inherited from class scale.score.pred.TraceChords |
---|
rl, thisChord, wl |
Constructor Summary | |
---|---|
FindAliases(AliasAnalysis analyzer,
Suite suite,
Aliases aliasesObject)
Create an object to find aliases in a scribble/score graph. |
Method Summary | |
---|---|
void |
findAliases(RoutineDecl cn,
Stack<Chord> wl)
Find the aliases for the specified routine. |
void |
pointerExpression(Expr expr)
A general routine that handles (potential) operations involving pointers. |
void |
visitArrayIndexExpr(ArrayIndexExpr e)
|
void |
visitCallFunctionExpr(CallFunctionExpr e)
Compute aliases at a function call node (FunctionCallOp. |
void |
visitCallMethodExpr(CallMethodExpr e)
Compute aliases for method calls. |
void |
visitDualExpr(DualExpr e)
|
void |
visitExpr(Expr expr)
Handle expressions that may involve pointer values. |
void |
visitExprChord(ExprChord c)
This is the main routine for handling aliases. |
void |
visitLiteralExpr(LiteralExpr e)
|
void |
visitLoadDeclAddressExpr(LoadDeclAddressExpr e)
Compute aliases at a LoadDeclAddressExpr node. |
void |
visitLoadDeclValueExpr(LoadDeclValueExpr e)
Compute aliases at a LoadDeclValueExpr node. |
void |
visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
Compute aliases at a LoadValueIndirectExpr node. |
void |
visitSubscriptExpr(SubscriptExpr e)
|
Methods inherited from class scale.score.pred.TraceChords |
---|
getChord, setChord, visitChord |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean classTrace
protected boolean trace
Constructor Detail |
---|
public FindAliases(AliasAnalysis analyzer, Suite suite, Aliases aliasesObject)
analyzer
- the alias analysis algorithm.suite
- the suite containing the procedures in the program.Method Detail |
---|
public void findAliases(RoutineDecl cn, Stack<Chord> wl)
public void visitCallFunctionExpr(CallFunctionExpr e)
visitCallFunctionExpr
in interface Predicate
visitCallFunctionExpr
in class Supertype
public void visitCallMethodExpr(CallMethodExpr e)
visitCallMethodExpr
in interface Predicate
visitCallMethodExpr
in class Supertype
public void visitLoadDeclAddressExpr(LoadDeclAddressExpr e)
visitLoadDeclAddressExpr
in interface Predicate
visitLoadDeclAddressExpr
in class Supertype
public void visitLoadDeclValueExpr(LoadDeclValueExpr e)
We check for array loads that appear on the RHS. In this case, we treat the operation as the expression (&a[0]).
visitLoadDeclValueExpr
in interface Predicate
visitLoadDeclValueExpr
in class Supertype
LoadDeclValueExpr
public void visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
visitLoadValueIndirectExpr
in interface Predicate
visitLoadValueIndirectExpr
in class Supertype
LoadValueIndirectExpr
public void visitExprChord(ExprChord c)
visitExprChord
in interface Predicate
visitExprChord
in class Supertype
ExprChord
public void visitExpr(Expr expr)
visitExpr
in class Supertype
expr
- the expressionpublic void visitLiteralExpr(LiteralExpr e)
visitLiteralExpr
in interface Predicate
visitLiteralExpr
in class Supertype
public void visitDualExpr(DualExpr e)
visitDualExpr
in interface Predicate
visitDualExpr
in class Supertype
public void visitSubscriptExpr(SubscriptExpr e)
visitSubscriptExpr
in interface Predicate
visitSubscriptExpr
in class Supertype
public void visitArrayIndexExpr(ArrayIndexExpr e)
visitArrayIndexExpr
in interface Predicate
visitArrayIndexExpr
in class Supertype
public void pointerExpression(Expr expr)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |