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 Quads 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>

Constructor Index

 o Quad(HCodeElement)
 o Quad(HCodeElement, int, int)
Constructor.

Method Index

 o addEdge(Quad, int, Quad, int)
Adds an edge between two Quads.
 o addEdges(Quad[])
Add edges between a string of Quads.
 o clone()
 o clone(Quad)
Create a new copy of a string of Quads starting at the given header.
 o def()
Return all the Temps defined by this Quad.
 o edges()
Returns an array with all the edges to and from this Quad.
 o getID()
Returns a unique numeric identifier for this Quad.
 o getLineNumber()
Returns the line in the original source file that this Quad is derived from.
 o getSourceElement()
Returns the HCodeElement that this Quad is derived from.
 o getSourceFile()
Returns the original source file name that this Quad is derived from.
 o next()
Returns an array containing all the successors of this quad, in order.
 o next(int)
Returns the ith successor of this quad.
 o nextEdge()
Returns an array containing all the outgoing edges from this quad.
 o nextEdge(int)
Returns the ith outgoing edge for this quad.
 o pred()
 o prev()
Returns an array containing all the predecessors of this quad, in order.
 o prev(int)
Returns the ith predecessor of this quad.
 o prevEdge()
Returns an array containing all the incoming edges of this quad.
 o prevEdge(int)
Returns the ith incoming edge of this quad.
 o rename(TempMap)
Rename all variables in this Quad according to a mapping.
 o renameDefs(TempMap)
Rename all defined variables in this Quad according to a mapping.
 o renameUses(TempMap)
Rename all used variables in this Quad according to a mapping.
 o succ()
 o toString()
Force everyone to reimplement toString()
 o use()
Return all the Temps used by this Quad.
 o visit(QuadVisitor)
Accept a visitor.

Constructors

 o Quad
 protected Quad(HCodeElement source,
                int prev_arity,
                int next_arity)
Constructor.

 o Quad
 protected Quad(HCodeElement source)

Methods

 o getSourceElement
 public HCodeElement getSourceElement()
Returns the HCodeElement that this Quad is derived from.

 o getSourceFile
 public String getSourceFile()
Returns the original source file name that this Quad is derived from.

 o getLineNumber
 public int getLineNumber()
Returns the line in the original source file that this Quad is derived from.

 o getID
 public int getID()
Returns a unique numeric identifier for this Quad.

 o toString
 public abstract String toString()
Force everyone to reimplement toString()

Overrides:
toString in class Object
 o visit
 public abstract void visit(QuadVisitor v)
Accept a visitor.

 o rename
 public void rename(TempMap tm)
Rename all variables in this Quad according to a mapping.

 o renameUses
 public void renameUses(TempMap tm)
Rename all used variables in this Quad according to a mapping.

 o renameDefs
 public void renameDefs(TempMap tm)
Rename all defined variables in this Quad according to a mapping.

 o use
 public Temp[] use()
Return all the Temps used by this Quad.

 o def
 public Temp[] def()
Return all the Temps defined by this Quad.

 o next
 public Quad next(int i)
Returns the ith successor of this quad.

 o prev
 public Quad prev(int i)
Returns the ith predecessor of this quad.

 o next
 public Quad[] next()
Returns an array containing all the successors of this quad, in order.

 o prev
 public Quad[] prev()
Returns an array containing all the predecessors of this quad, in order.

 o nextEdge
 public Edge[] nextEdge()
Returns an array containing all the outgoing edges from this quad.

 o prevEdge
 public Edge[] prevEdge()
Returns an array containing all the incoming edges of this quad.

 o nextEdge
 public Edge nextEdge(int i)
Returns the ith outgoing edge for this quad.

 o prevEdge
 public Edge prevEdge(int i)
Returns the ith incoming edge of this quad.

 o edges
 public HCodeEdge[] edges()
Returns an array with all the edges to and from this Quad.

 o pred
 public HCodeEdge[] pred()
 o succ
 public HCodeEdge[] succ()
 o addEdge
 public static Edge addEdge(Quad from,
                            int from_index,
                            Quad to,
                            int to_index)
Adds an edge between two Quads. The from_indexed outgoing edge of from is connected to the to_indexed incoming edge of to.

Returns:
the added Edge.
 o 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.

 o clone
 public Object clone()
Overrides:
clone in class Object
 o clone
 public static Quad clone(Quad header)
Create a new copy of a string of Quads starting at the given header.


All Packages  Class Hierarchy  This Package  Previous  Next  Index