|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.CDG
public class CDG
The CDG class builds the control dependence graph for the scribble graph input.
$Id: CDG.java,v 1.30 2007-10-04 19:58:18 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
The representation is a hash set to a vector of Chords.
The reverse representation is a hash of the first chords to a vector of the controlling branch points (yes, there can be more than one), again, each of which is the last chord in the basic block with the branch point.
Constructor Summary | |
---|---|
CDG(Scribble scribble)
Calculates the CDG from the scribble graph. |
Method Summary | |
---|---|
void |
dumpCDG()
Output the CDG for debugging. |
Vector<Chord> |
getDependents(Chord parent)
Return a list of CFG nodes that are immediately dependent on this node. |
java.util.HashMap<Chord,java.lang.Boolean> |
getParents(Chord child)
Returns a map from the child CFG node to the Chord(s) upon which the child is control dependent. |
void |
updateKey(Chord oldKey,
Chord newKey)
CDG lookups are done based on the first basic block, if a client changes the basic blocks, they must update the CDG. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CDG(Scribble scribble)
scribble
- is the Scribble graph representing a single routineMethod Detail |
---|
public java.util.HashMap<Chord,java.lang.Boolean> getParents(Chord child)
The parent node is the key in the map and the condition
(true, false or null) is the value. A value of null should only
be associated with the BeginChord
.
It is legal for the map to contain the BeginChord
instance along with other
CFG nodes. To check for control independence, the caller should
check there is only one parent and that it is the BeginChord or
for null.
child
- the Chord whose parent is returned.public Vector<Chord> getDependents(Chord parent)
null
is returned.
public void updateKey(Chord oldKey, Chord newKey)
oldKey
- old chord that was the first basic blocknewKey
- new chord that is the first basic blockpublic void dumpCDG()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |