|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.pred.References
public class References
This class scans a Scribble CFG looking for declaration
references.
$Id: References.java,v 1.75 2007-10-04 19:58:34 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
For this class, a definition of a variable is a place where it is (potentially) given a new value. A use site is where a variable's value is used. A reference site is any place that a variable is used or defined.
Constructor Summary | |
---|---|
References()
Construct a predicate to visit all the expressions in a CFG to determine all the places declarations are referenced. |
Method Summary | |
---|---|
boolean |
anyDefChords(Declaration var)
Return true if there are any defs of a variable. |
boolean |
anyUseChords(Declaration var)
Return true if there are any uses of a variable. |
void |
compute(Scribble scribble)
Determine the actual declaration references. |
static int |
computed()
Return the number of times the dominance frontier was computed. |
static int |
created()
Return the number of instances of this class that were created. |
java.util.Iterator<Chord> |
getDefChords(Declaration var)
Return an iteration of the statements with definition sites for a given variable. |
HashSet<Chord> |
getDefChordSet(Declaration var)
Return a set of statements with definition sites for a given variable. |
java.util.Iterator<Declaration> |
getGlobalVars()
Return an iteration of the global variables, that are not const, which are referenced in this procedure. |
java.util.Iterator<Declaration> |
getStaticVars()
Return an iteration of the local static variables, that are not const, which are referenced in this procedure. |
java.util.Iterator<Chord> |
getUseChords(Declaration var)
Return an iteration of basic blocks with use sites for a given variable. |
HashSet<Chord> |
getUseChordSet(Declaration var)
Return a set of statements with use sites for a given variable. |
boolean |
isValid()
Return true if the reference information is valid. |
int |
numDefChords(Declaration var)
Return the numberof definition sites. |
void |
recordDef(Chord stmt,
Expr expr,
Declaration decl)
Record the definition (kill) of a variable. |
void |
recordUse(Chord stmt,
Expr expr,
Declaration decl)
Record the use of a variable. |
void |
remove(Chord stmt,
Declaration v)
Remove all mappings from the specified variable to the specified CFG node. |
void |
removeVars(VariableDecl v)
Remove a VariableDecl from the list of global variables list of local static variables Note - the use & def information is not modified. |
void |
setInvalid()
Specify that the reference information is invalid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public References()
Method Detail |
---|
public static int created()
public static int computed()
public void compute(Scribble scribble)
public final boolean isValid()
public void setInvalid()
public final java.util.Iterator<Declaration> getGlobalVars()
public final java.util.Iterator<Declaration> getStaticVars()
public final HashSet<Chord> getDefChordSet(Declaration var)
public final HashSet<Chord> getUseChordSet(Declaration var)
public final java.util.Iterator<Chord> getDefChords(Declaration var)
public final int numDefChords(Declaration var)
public final java.util.Iterator<Chord> getUseChords(Declaration var)
public final boolean anyUseChords(Declaration var)
public final boolean anyDefChords(Declaration var)
public void recordUse(Chord stmt, Expr expr, Declaration decl)
expr
- is the expression where the variable is used.decl
- is the declaration of the variable.public final void removeVars(VariableDecl v)
v
- is the variablepublic final void remove(Chord stmt, Declaration v)
public void recordDef(Chord stmt, Expr expr, Declaration decl)
expr
- the expression where the variable is defined (killed)decl
- the declaration of the variable.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |