All Packages Class Hierarchy This Package Previous Next Index
Class harpoon.IR.QuadSSA.Quad
java.lang.Object
|
+----harpoon.IR.QuadSSA.Quad
- public abstract class Quad
- extends Object
- implements HCodeElement, UseDef, Edges, Renameable, Cloneable
Quad
is the base class for the quadruple representation.
No Quad
s throw exceptions implicitly.
- Version:
- $Id: Quad.java,v 1.29 1998/11/10 03:34:11 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>
-
Quad(HCodeElement)
-
-
Quad(HCodeElement, int, int)
- Constructor.
-
addEdge(Quad, int, Quad, int)
- Adds an edge between two Quads.
-
addEdges(Quad[])
- Add edges between a string of Quads.
-
clone()
-
-
clone(Quad)
- Create a new copy of a string of
Quad
s starting at
the given header.
-
def()
- Return all the Temps defined by this Quad.
-
edges()
- Returns an array with all the edges to and from this
Quad
.
-
getID()
- Returns a unique numeric identifier for this
Quad
.
-
getLineNumber()
- Returns the line in the original source file that this
Quad
is derived from.
-
getSourceElement()
- Returns the
HCodeElement
that this Quad
is derived from.
-
getSourceFile()
- Returns the original source file name that this
Quad
is derived from.
-
next()
- Returns an array containing all the successors of this quad,
in order.
-
next(int)
- Returns the
i
th successor of this quad.
-
nextEdge()
- Returns an array containing all the outgoing edges from this quad.
-
nextEdge(int)
- Returns the
i
th outgoing edge for this quad.
-
pred()
-
-
prev()
- Returns an array containing all the predecessors of this quad,
in order.
-
prev(int)
- Returns the
i
th predecessor of this quad.
-
prevEdge()
- Returns an array containing all the incoming edges of this quad.
-
prevEdge(int)
- Returns the
i
th incoming edge of this quad.
-
rename(TempMap)
- Rename all variables in this Quad according to a mapping.
-
renameDefs(TempMap)
- Rename all defined variables in this Quad according to a mapping.
-
renameUses(TempMap)
- Rename all used variables in this Quad according to a mapping.
-
succ()
-
-
toString()
- Force everyone to reimplement toString()
-
use()
- Return all the Temps used by this Quad.
-
visit(QuadVisitor)
- Accept a visitor.
Quad
protected Quad(HCodeElement source,
int prev_arity,
int next_arity)
- Constructor.
Quad
protected Quad(HCodeElement source)
getSourceElement
public HCodeElement getSourceElement()
- Returns the
HCodeElement
that this Quad
is derived from.
getSourceFile
public String getSourceFile()
- Returns the original source file name that this
Quad
is derived from.
getLineNumber
public int getLineNumber()
- Returns the line in the original source file that this
Quad
is derived from.
getID
public int getID()
- Returns a unique numeric identifier for this
Quad
.
toString
public abstract String toString()
- Force everyone to reimplement toString()
- Overrides:
- toString in class Object
visit
public abstract void visit(QuadVisitor v)
- Accept a visitor.
rename
public void rename(TempMap tm)
- Rename all variables in this Quad according to a mapping.
renameUses
public void renameUses(TempMap tm)
- Rename all used variables in this Quad according to a mapping.
renameDefs
public void renameDefs(TempMap tm)
- Rename all defined variables in this Quad according to a mapping.
use
public Temp[] use()
- Return all the Temps used by this Quad.
def
public Temp[] def()
- Return all the Temps defined by this Quad.
next
public Quad next(int i)
- Returns the
i
th successor of this quad.
prev
public Quad prev(int i)
- Returns the
i
th predecessor of this quad.
next
public Quad[] next()
- Returns an array containing all the successors of this quad,
in order.
prev
public Quad[] prev()
- Returns an array containing all the predecessors of this quad,
in order.
nextEdge
public Edge[] nextEdge()
- Returns an array containing all the outgoing edges from this quad.
prevEdge
public Edge[] prevEdge()
- Returns an array containing all the incoming edges of this quad.
nextEdge
public Edge nextEdge(int i)
- Returns the
i
th outgoing edge for this quad.
prevEdge
public Edge prevEdge(int i)
- Returns the
i
th incoming edge of this quad.
edges
public HCodeEdge[] edges()
- Returns an array with all the edges to and from this
Quad
.
pred
public HCodeEdge[] pred()
succ
public HCodeEdge[] succ()
addEdge
public static Edge addEdge(Quad from,
int from_index,
Quad to,
int to_index)
- Adds an edge between two Quads. The
from_index
ed
outgoing edge of from
is connected to the
to_index
ed incoming edge of to
.
- Returns:
- the added
Edge
.
addEdges
public static void addEdges(Quad quadlist[])
- Add edges between a string of Quads. The first outgoing edge
is connected to the first incoming edge for all edges added.
The same as multiple
addEdge(q[i], 0, q[i+1], 0)
calls.
clone
public Object clone()
- Overrides:
- clone in class Object
clone
public static Quad clone(Quad header)
- Create a new copy of a string of
Quad
s starting at
the given header.
All Packages Class Hierarchy This Package Previous Next Index