harpoon.IR.Quads
Class CJMP

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

public class CJMP
extends SIGMA

CJMP represents conditional branches.

next[0] is if-false, which is taken if the operand is equal to zero. next[1] is if-true branch, taken when the operand is not equal to zero.

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

Field Summary
protected  Temp test
           
 
Fields inherited from class harpoon.IR.Quads.SIGMA
dst, src
 
Fields inherited from class harpoon.IR.Quads.Quad
arrayFactory
 
Constructor Summary
CJMP(QuadFactory qf, HCodeElement source, Temp test, Temp[] src)
          Creates a CJMP representing a conditional branch.
CJMP(QuadFactory qf, HCodeElement source, Temp test, Temp[][] dst, Temp[] src)
          Creates a CJMP representing a conditional branch.
 
Method Summary
<T> T
accept(QuadValueVisitor<T> v)
           
 void accept(QuadVisitor v)
          Accept a visitor.
 int kind()
          Return an integer enumeration of the kind of this Quad.
 Quad rename(QuadFactory qqf, TempMap defMap, TempMap useMap)
          Create a new Quad identical to the receiver, but with all Temps renamed according to a mapping.
 Temp test()
          Returns the Temp tested by this CJMP.
 String toString()
          Returns human-readable representation.
 Temp[] use()
          Returns all the Temps used by this Quad.
 
Methods inherited from class harpoon.IR.Quads.SIGMA
arity, assign, def, dst, dst, dst, numSigmas, removeSigma, src, src
 
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, map, map, map, next, next, nextEdge, nextEdge, nextLength, pred, predC, prev, prev, prevEdge, prevEdge, prevLength, remove, removeHandlers, rename, replace, succ, succC, toLongString, transferHandlers, useC
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

test

protected Temp test
Constructor Detail

CJMP

public CJMP(QuadFactory qf,
            HCodeElement source,
            Temp test,
            Temp[][] dst,
            Temp[] src)
Creates a CJMP representing a conditional branch.

Parameters:
test - the Temp tested by this branch.
src - the source Temps for the underlying SIGMA.
dst - the destination Temps for the underlying SIGMA.

CJMP

public CJMP(QuadFactory qf,
            HCodeElement source,
            Temp test,
            Temp[] src)
Creates a CJMP representing a conditional branch. Abbreviated form of the constructor uses an appropriately-sized array of null values for the dst field.

Method Detail

test

public Temp test()
Returns the Temp tested by this CJMP.


use

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

Specified by:
use in interface UseDefable
Overrides:
use in class SIGMA
Returns:
the test field.

kind

public int kind()
Description copied from class: Quad
Return an integer enumeration of the kind of this Quad. The enumerated values are defined in QuadKind.

Specified by:
kind in class Quad

rename

public Quad rename(QuadFactory qqf,
                   TempMap defMap,
                   TempMap useMap)
Description copied from class: Quad
Create a new Quad identical to the receiver, but with all Temps renamed according to a mapping. The new Quad will have no edges.

The new Quad will come from the specified QuadFactory.

Specified by:
rename in class Quad

accept

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

Overrides:
accept in class SIGMA

accept

public <T> T accept(QuadValueVisitor<T> v)
Overrides:
accept in class SIGMA

toString

public String toString()
Returns human-readable representation.

Overrides:
toString in class SIGMA