|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.Note scale.score.chords.Chord scale.score.chords.SequentialChord scale.score.chords.EndChord scale.score.chords.LeaveChord
public abstract class LeaveChord
This class is a parent class for routine terminating statements.
$Id: LeaveChord.java,v 1.43 2007-10-17 13:39:59 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Though not an inherent property of routine terminating
statements, the ones that exist (return
and
exit
) potentially carry a single data value.
Field Summary |
---|
Fields inherited from class scale.score.chords.Chord |
---|
lineNumber |
Constructor Summary | |
---|---|
LeaveChord()
|
|
LeaveChord(Expr resultValue)
|
Method Summary | |
---|---|
void |
changeInDataEdge(Expr oldExpr,
Expr newExpr)
This method changes an incoming data edge to point to a new expression. |
void |
deleteInDataEdges()
Remove all the in-coming adat edges. |
int |
executionCostEstimate()
Return a relative cost estimate for executing the expression. |
Vector<Declaration> |
getDeclList()
Return a vector of all declarations referenced in this CFG node or null . |
Vector<Expr> |
getExprList()
Return a vector of all LoadExpr
instances in this CFG node or null . |
Expr |
getInDataEdge(int i)
Return the specified in-coming data edge. |
Expr[] |
getInDataEdgeArray()
Use this method when you may be modifying an in-coming data edge to this expression while iterating over the in-coming edges. |
Vector<LoadExpr> |
getLoadExprList()
Return a vector of all LoadExpr
instances in this CFG node or null . |
Expr |
getResultValue()
Return the expression that defines the result of the routine. |
int |
numInDataEdges()
Return the number of in-coming data edges. |
void |
pushInDataEdges(Stack<Expr> wl)
Push all incoming data edges on the stack. |
void |
recordRefs(References refs)
Record any variable references in this CFG node in the table of references. |
boolean |
removeDualExprs()
Remove all DualExpr instances from the CFG. |
void |
removeRefs(References refs)
Remove any variable references in this CFG node from the table of references. |
void |
removeUseDef()
Remove any use - def links, may - use links, etc. |
boolean |
replaceDecl(Declaration oldDecl,
Declaration newDecl)
Replace all occurrances of a declaration with another Declaration. |
void |
setResultValue(Expr resultValue)
Set the expression that defines the result of the routine. |
java.lang.String |
toStringSpecial()
Return a string containing additional information about this Chord. |
void |
validate()
Check this node for validity. |
Methods inherited from class scale.score.chords.EndChord |
---|
copy, linkTo, setTarget, visit |
Methods inherited from class scale.score.chords.SequentialChord |
---|
changeOutCfgEdge, clearEdge, clearEdgeMarkers, deleteOutCfgEdges, edgeMarked, getNextChord, getOutCfgEdge, getOutCfgEdgeArray, getTarget, indexOfOutCfgEdge, isLastInBasicBlock, isSequential, linkSubgraph, markEdge, numOutCfgEdges, pushAllOutCfgEdges, pushOutCfgEdges, pushOutCfgEdges, pushSortedOutCfgEdges, pushSortedOutCfgEdges, replaceOutCfgEdge, setTargetUnsafe |
Methods inherited from class scale.score.Note |
---|
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LeaveChord(Expr resultValue)
resultValue
- is the expression that defines the result of
the routine or nullpublic LeaveChord()
Method Detail |
---|
public final Expr[] getInDataEdgeArray()
getInDataEdgeArray
in class Chord
public final Expr getInDataEdge(int i)
getInDataEdge
in class Chord
public final int numInDataEdges()
numInDataEdges
in class Chord
public void pushInDataEdges(Stack<Expr> wl)
pushInDataEdges
in class Chord
public Expr getResultValue()
public void setResultValue(Expr resultValue)
public void changeInDataEdge(Expr oldExpr, Expr newExpr)
This method ensures that the node previously pointing to this one is updated properly, as well as, the node which will now point to this node.
Expr and Chord nodes have a fixed number of incoming edges with specific meaning applied to each. Hence, the edge being replaced is indicated by position.
changeInDataEdge
in class Chord
oldExpr
- is the expression to be replacednewExpr
- is the new expressionpublic void deleteInDataEdges()
deleteInDataEdges
in class SequentialChord
public java.lang.String toStringSpecial()
toStringSpecial
in class Chord
public Vector<Declaration> getDeclList()
declarations
referenced in this CFG node or null
.
getDeclList
in class SequentialChord
public Vector<LoadExpr> getLoadExprList()
LoadExpr
instances in this CFG node or null
.
getLoadExprList
in class SequentialChord
public Vector<Expr> getExprList()
LoadExpr
instances in this CFG node or null
.
getExprList
in class SequentialChord
public boolean replaceDecl(Declaration oldDecl, Declaration newDecl)
declaration
with another Declaration. Return true if a replace
occurred.
replaceDecl
in class SequentialChord
public void removeUseDef()
removeUseDef
in class SequentialChord
public void validate()
validate
in class Note
public void recordRefs(References refs)
recordRefs
in class Chord
public void removeRefs(References refs)
removeRefs
in class Chord
public int executionCostEstimate()
executionCostEstimate
in class SequentialChord
public boolean removeDualExprs()
removeDualExprs
in class Chord
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |