harpoon.IR.Quads
Class SIGMA

java.lang.Object
  extended by harpoon.IR.Quads.Quad
      extended by harpoon.IR.Quads.SIGMA
All Implemented Interfaces:
HCodeElement, CFGraphable<Quad,Edge>, UseDefable, Graph.Node<Quad,Edge>, Serializable, Cloneable, Comparable<Quad>
Direct Known Subclasses:
CALL, CJMP, PCALL, SWITCH, TYPESWITCH

public abstract class SIGMA
extends Quad

SIGMA functions are added where control flow splits.

They have the form: <t1, t2, ..., tn> = sigma(t0).

Version:
$Id: SIGMA.java,v 1.5 2002/04/11 04:00:35 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Field Summary
protected  Temp[][] dst
          dst[i][j] is the j'th element of the tuple on the left-hand side of the i'th sigma function in this block.
protected  Temp[] src
          src[i] is the argument to the i'th sigma function in this block.
 
Fields inherited from class harpoon.IR.Quads.Quad
arrayFactory
 
Constructor Summary
SIGMA(QuadFactory qf, HCodeElement source, Temp[][] dst, Temp[] src, int arity)
          Creates a SIGMA representing a block of sigma functions.
SIGMA(QuadFactory qf, HCodeElement source, Temp[] src, int arity)
          Creates a SIGMA object with the specified arity.
 
Method Summary
<T> T
accept(QuadValueVisitor<T> v)
           
 void accept(QuadVisitor v)
          Accept a visitor.
 int arity()
          Returns the number of elements in the tuple returned by each sigma function.
 void assign(Temp[] d, int which_succ)
           
 Temp[] def()
          Return all the Temps defined by this Quad.
 Temp[][] dst()
           
 Temp[] dst(int nSigma)
          Returns an array holding the elements of the tuple returned by the nSigma'th sigma function in the block.
 Temp dst(int nSigma, int nTuple)
          Returns the nTuple'th element of the tuple returned by the nSigma'th sigma function in the block.
 int numSigmas()
          Returns the number of sigma functions in the block.
 void removeSigma(int nSigma)
          Deprecated. Does not preserve immutability.
 Temp[] src()
           
 Temp src(int nSigma)
          Returns the argument to the nSigma'th sigma function in the block.
 String toString()
          Force everyone to reimplement toString()
 Temp[] use()
          Return all the Temps used by this Quad.
 
Methods inherited from class harpoon.IR.Quads.Quad
addEdge, addEdges, addHandlers, clone, clone, clone, compareTo, defC, edgeC, edges, getFactory, getID, getLineNumber, getSourceFile, handlers, hashCode, isPred, isSucc, kind, map, map, map, next, next, nextEdge, nextEdge, nextLength, pred, predC, prev, prev, prevEdge, prevEdge, prevLength, remove, removeHandlers, rename, rename, replace, succ, succC, toLongString, transferHandlers, useC
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dst

protected Temp[][] dst
dst[i][j] is the j'th element of the tuple on the left-hand side of the i'th sigma function in this block.


src

protected Temp[] src
src[i] is the argument to the i'th sigma function in this block.

Constructor Detail

SIGMA

public SIGMA(QuadFactory qf,
             HCodeElement source,
             Temp[][] dst,
             Temp[] src,
             int arity)
Creates a SIGMA representing a block of sigma functions.

Parameters:
dst - the elements of the tuples on the left-hand side of a sigma function assignment block.
src - the arguments to the sigma functions in this block.

SIGMA

public SIGMA(QuadFactory qf,
             HCodeElement source,
             Temp[] src,
             int arity)
Creates a SIGMA object with the specified arity. Each sigma function will return a tuple with arity elements.

Parameters:
src - the arguments to the sigma functions.
arity - the number of successors to this quad.
Method Detail

src

public Temp src(int nSigma)
Returns the argument to the nSigma'th sigma function in the block.


dst

public Temp dst(int nSigma,
                int nTuple)
Returns the nTuple'th element of the tuple returned by the nSigma'th sigma function in the block.


dst

public Temp[] dst(int nSigma)
Returns an array holding the elements of the tuple returned by the nSigma'th sigma function in the block.


src

public Temp[] src()

dst

public Temp[][] dst()

numSigmas

public int numSigmas()
Returns the number of sigma functions in the block.


arity

public int arity()
Returns the number of elements in the tuple returned by each sigma function.


removeSigma

public void removeSigma(int nSigma)
Deprecated. Does not preserve immutability.

Removes a given sigma function from the block.


assign

public void assign(Temp[] d,
                   int which_succ)

use

public Temp[] use()
Description copied from class: Quad
Return all the Temps used by this Quad.

Specified by:
use in interface UseDefable
Overrides:
use in class Quad

def

public Temp[] def()
Description copied from class: Quad
Return all the Temps defined by this Quad.

Specified by:
def in interface UseDefable
Overrides:
def in class Quad

accept

public void accept(QuadVisitor v)
Description copied from class: Quad
Accept a visitor.

Specified by:
accept in class Quad

accept

public <T> T accept(QuadValueVisitor<T> v)
Specified by:
accept in class Quad

toString

public String toString()
Description copied from class: Quad
Force everyone to reimplement toString()

Specified by:
toString in class Quad