|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectharpoon.IR.Quads.Quad
public abstract class Quad
Quad is the base class for the quadruple representation.
| Field Summary | |
|---|---|
static ArrayFactory<Quad> |
arrayFactory
Array factory: returns Quad[]s |
| Constructor Summary | |
|---|---|
protected |
Quad(QuadFactory qf,
HCodeElement source)
Initializes a quad with exactly one input edge and exactly one output edge. |
protected |
Quad(QuadFactory qf,
HCodeElement source,
int prev_arity,
int next_arity)
Initializes a quad with prev_arity input edges and
next_arity output edges. |
| Method Summary | ||
|---|---|---|
abstract
|
accept(QuadValueVisitor<T> v)
|
|
abstract void |
accept(QuadVisitor v)
Accept a visitor. |
|
static Edge |
addEdge(Quad from,
int from_index,
Quad to,
int to_index)
Adds an edge between two Quads. |
|
static void |
addEdges(Quad[] quadlist)
Add edges between a string of Quads. |
|
void |
addHandlers(HandlerSet handlers)
Add this quad to the given handler sets. |
|
Quad |
clone()
|
|
Quad |
clone(QuadFactory qf,
CloningTempMap tm)
Clone a quad into a new quad factory, renaming all of the temps according to tm (which ought to ensure that all
the new temps belong to the TempFactory of the
new QuadFactory). |
|
static Quad |
clone(QuadFactory qf,
Quad header)
Create a new copy of a string of Quads starting at
the given header using QuadFactory. |
|
int |
compareTo(Quad o)
|
|
Temp[] |
def()
Return all the Temps defined by this Quad. |
|
Collection<Temp> |
defC()
Returns a Collection of all the
Temps defined in this HCodeElement. |
|
List<Edge> |
edgeC()
Returns a List of all the edges to and from
this HCodeElement. |
|
Edge[] |
edges()
Returns an array of all the edges to and from this CFGraphable. |
|
QuadFactory |
getFactory()
Returns the QuadFactory that generated this
Quad. |
|
int |
getID()
Returns a unique numeric identifier for this Quad. |
|
int |
getLineNumber()
Returns the line in the original source file that this Quad is derived from. |
|
String |
getSourceFile()
Returns the original source file name that this Quad
is derived from. |
|
HandlerSet |
handlers()
Return a set of all the handlers guarding this Quad. |
|
int |
hashCode()
|
|
boolean |
isPred(Quad q)
Return true iff the given node is a predecessor of this node. |
|
boolean |
isSucc(Quad q)
Return true iff the given node is a successor of this node. |
|
abstract int |
kind()
Return an integer enumeration of the kind of this Quad. |
|
protected static Temp |
map(TempMap tm,
Temp t)
Apply TempMap tm to Temp
t. |
|
protected static Temp[] |
map(TempMap tm,
Temp[] ta)
Apply TempMap to array of Temps. |
|
protected static Temp[][] |
map(TempMap tm,
Temp[][] taa)
Apply TempMap to 2-d array of Temps. |
|
Quad[] |
next()
Returns an array containing all the successors of this quad, in order. |
|
Quad |
next(int i)
Returns the ith successor of this quad. |
|
Edge[] |
nextEdge()
Returns an array containing all the outgoing edges from this quad. |
|
Edge |
nextEdge(int i)
Returns the ith outgoing edge for this quad. |
|
int |
nextLength()
Return the number of successors of this quad. |
|
Edge[] |
pred()
Returns an array of all the edges entering this CFGraphable. |
|
List<Edge> |
predC()
Returns a List of all the edges to
this HCodeElement. |
|
Quad[] |
prev()
Returns an array containing all the predecessors of this quad, in order. |
|
Quad |
prev(int i)
Returns the ith predecessor of this quad. |
|
Edge[] |
prevEdge()
Returns an array containing all the incoming edges of this quad. |
|
Edge |
prevEdge(int i)
Returns the ith incoming edge of this quad. |
|
int |
prevLength()
Return the number of predecessors of this quad. |
|
Edge |
remove()
Remove this quad from the graph. |
|
void |
removeHandlers(HandlerSet handlers)
Remove this quad from the given handler sets. |
|
abstract Quad |
rename(QuadFactory qf,
TempMap defMap,
TempMap useMap)
Create a new Quad identical to the receiver, but
with all Temps renamed according to a mapping. |
|
Quad |
rename(TempMap defMap,
TempMap useMap)
Create a new Quad identical to the receiver, but
with all Temps renamed according to a mapping. |
|
static void |
replace(Quad oldQ,
Quad newQ)
Replace one quad with another. |
|
Edge[] |
succ()
Returns an array of all the edges leaving this CFGraphable. |
|
List<Edge> |
succC()
Returns a List of all the edges from
this HCodeElement. |
|
String |
toLongString()
Returns a string representation of this quad containing the source file and the line number info, in addition to the other information provided by the regulat toString(). |
|
abstract String |
toString()
Force everyone to reimplement toString() |
|
static void |
transferHandlers(Quad oldQ,
Quad newQ)
Update the handlers for newQ to match the handlers for oldQ, removing handlers from oldQ in the process. |
|
Temp[] |
use()
Return all the Temps used by this Quad. |
|
Collection<Temp> |
useC()
Returns a Collection of all the
Temps read in this HCodeElement. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ArrayFactory<Quad> arrayFactory
Quad[]s
| Constructor Detail |
|---|
protected Quad(QuadFactory qf,
HCodeElement source,
int prev_arity,
int next_arity)
prev_arity input edges and
next_arity output edges.
protected Quad(QuadFactory qf,
HCodeElement source)
| Method Detail |
|---|
public int hashCode()
hashCode in class Objectpublic QuadFactory getFactory()
QuadFactory that generated this
Quad.
public String getSourceFile()
Quad
is derived from.
getSourceFile in interface HCodeElementpublic int getLineNumber()
Quad is derived from.
getLineNumber in interface HCodeElementpublic int getID()
Quad.
getID in interface HCodeElementpublic abstract String toString()
toString in class Objectpublic String toLongString()
public abstract void accept(QuadVisitor v)
public abstract <T> T accept(QuadValueVisitor<T> v)
public abstract int kind()
Quad. The enumerated values are defined in
QuadKind.
public abstract Quad rename(QuadFactory qf,
TempMap defMap,
TempMap useMap)
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.
public final Quad rename(TempMap defMap,
TempMap useMap)
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 same
QuadFactory as the receiver.
public Temp[] use()
use in interface UseDefablepublic Temp[] def()
def in interface UseDefablepublic Collection<Temp> useC()
UseDefableCollection of all the
Temps read in this HCodeElement.
useC in interface UseDefablepublic Collection<Temp> defC()
UseDefableCollection of all the
Temps defined in this HCodeElement.
defC in interface UseDefablepublic Quad next(int i)
ith successor of this quad.
public Quad prev(int i)
ith predecessor of this quad.
public int nextLength()
public int prevLength()
public Quad[] next()
public Quad[] prev()
public Edge[] nextEdge()
public Edge[] prevEdge()
public Edge nextEdge(int i)
ith outgoing edge for this quad.
public Edge prevEdge(int i)
ith incoming edge of this quad.
public Edge[] edges()
CFGraphableCFGraphable.
edges in interface CFGraphable<Quad,Edge>public Edge[] pred()
CFGraphableCFGraphable.
pred in interface CFGraphable<Quad,Edge>public Edge[] succ()
CFGraphableCFGraphable.
succ in interface CFGraphable<Quad,Edge>public List<Edge> edgeC()
CFGraphableList of all the edges to and from
this HCodeElement.
edgeC in interface CFGraphable<Quad,Edge>public List<Edge> predC()
CFGraphableList of all the edges to
this HCodeElement.
Each CFGEdge returned is guaranteed to return
this in response to a call to to();
the actual predecessor will be returned from
from().
predC in interface CFGraphable<Quad,Edge>predC in interface Graph.Node<Quad,Edge>public List<Edge> succC()
CFGraphableList of all the edges from
this HCodeElement.
Each CFGEdge returned is guaranteed to return
this in response to a call to
from(); the actual successor to this
will be returned from to().
succC in interface CFGraphable<Quad,Edge>succC in interface Graph.Node<Quad,Edge>public boolean isSucc(Quad q)
Graph.Node
isSucc in interface Graph.Node<Quad,Edge>public boolean isPred(Quad q)
Graph.Node
isPred in interface Graph.Node<Quad,Edge>
public static Edge addEdge(Quad from,
int from_index,
Quad to,
int to_index)
from_indexed
outgoing edge of from is connected to the
to_indexed incoming edge of to.
Edge.public static void addEdges(Quad[] quadlist)
addEdge(q[i], 0, q[i+1], 0)
calls.
public static void replace(Quad oldQ,
Quad newQ)
public Edge remove()
public static void transferHandlers(Quad oldQ,
Quad newQ)
public final void addHandlers(HandlerSet handlers)
public final void removeHandlers(HandlerSet handlers)
public final HandlerSet handlers()
Quad.
public int compareTo(Quad o)
compareTo in interface Comparable<Quad>public final Quad clone()
clone in class Object
public final Quad clone(QuadFactory qf,
CloningTempMap tm)
tm (which ought to ensure that all
the new temps belong to the TempFactory of the
new QuadFactory).
public static Quad clone(QuadFactory qf,
Quad header)
Quads starting at
the given header using QuadFactory.
protected static final Temp map(TempMap tm,
Temp t)
TempMap tm to Temp
t.
tm.tempMap(t) if t is
non-null, or null if t is
null.
protected static final Temp[] map(TempMap tm,
Temp[] ta)
TempMap to array of Temps.
Null Temps get mapped to null.
protected static final Temp[][] map(TempMap tm,
Temp[][] taa)
TempMap to 2-d array of Temps.
Null Temps get mapped to null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||