public class SPhiExpr extends java.lang.Object implements PhiExpr
PhiExpr,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<ValueUnitPair> |
argPairs |
protected java.util.Map<Unit,ValueUnitPair> |
predToPair |
protected Type |
type |
| Constructor and Description |
|---|
SPhiExpr(java.util.List<Value> args,
java.util.List<Unit> preds)
Create a Phi expression from the given list of Values and Blocks.
|
SPhiExpr(Local leftLocal,
java.util.List<Block> preds)
Create a trivial Phi expression for leftLocal.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addArg(Value arg,
Block pred)
Add the given argument associated with the given CFG
predecessor.
|
boolean |
addArg(Value arg,
Unit predTailUnit)
Add the given argument associated with the given CFG
predecessor.
|
void |
apply(Switch sw)
Called when this object is visited.
|
void |
clearUnitBoxes() |
java.lang.Object |
clone()
Returns a clone of this Value.
|
int |
equivHashCode()
Returns a (not necessarily fixed) hash code for this object.
|
boolean |
equivTo(java.lang.Object o)
Returns true if this object is equivalent to o.
|
ValueUnitPair |
getArgBox(Block pred)
Returns the argument pair corresponding to the given CFG
predecessor.
|
ValueUnitPair |
getArgBox(int index)
Returns the argument pair for the given index.
|
ValueUnitPair |
getArgBox(Unit predTailUnit)
Returns the argument pair corresponding to the given CFG
predecessor.
|
int |
getArgCount()
Returns the number of arguments in this PhiExpr.
|
int |
getArgIndex(Block pred)
Returns the index of the argument associated with the given
control flow predecessor.
|
int |
getArgIndex(Unit predTailUnit)
Returns the index of the argument associated with the given
control flow predecessor Unit.
|
java.util.List<ValueUnitPair> |
getArgs()
Returns an unmodifiable, backed view of the arguments to this PhiExpr.
|
int |
getBlockId()
Returns the id number of the block from which the Phi node
originated from.
|
Unit |
getPred(int index)
Returns the control flow predecessor Unit for the given index
into the PhiExpr.
|
java.util.List<Unit> |
getPreds()
Returns a list of the control flow predecessor Units being
tracked by this PhiExpr
|
Type |
getType()
The type of the PhiExpr is usually the same as the type of its
arguments.
|
java.util.List<UnitBox> |
getUnitBoxes() |
java.util.List<ValueBox> |
getUseBoxes()
Returns a List of boxes corresponding to Values
which are used by (ie contained within) this Value.
|
Value |
getValue(Block pred)
Get the PhiExpr argument corresponding to the given control flow
predecessor, returns null if not available.
|
Value |
getValue(int index)
Returns the value for the given index into the PhiExpr.
|
Value |
getValue(Unit predTailUnit)
Get the PhiExpr argument corresponding to the given control
flow predecessor, returns null if not available.
|
java.util.List<Value> |
getValues()
Returns a list of the values used by this PhiExpr.
|
boolean |
removeArg(Block pred)
Remove the argument corresponding to the given CFG predecessor.
|
boolean |
removeArg(int index)
Remove the argument at the given index.
|
boolean |
removeArg(Unit predTailUnit)
Remove the argument corresponding to the given CFG predecessor.
|
boolean |
removeArg(ValueUnitPair arg)
Remove the given argument.
|
boolean |
setArg(int index,
Value arg,
Block pred)
Modify the PhiExpr argument at the given index with the given
information.
|
boolean |
setArg(int index,
Value arg,
Unit predTailUnit)
Modify the PhiExpr argument at the given index with the given
information.
|
void |
setBlockId(int blockId)
Set the block number of the Phi node.
|
boolean |
setPred(int index,
Block pred)
Update the CFG predecessor associated with the PhiExpr
argument at the given index.
|
boolean |
setPred(int index,
Unit predTailUnit)
Update the CFG predecessor associated with the PhiExpr
argument at the given index.
|
boolean |
setValue(Block pred,
Value arg)
Locate the argument associated with the given CFG predecessor
and set the value.
|
boolean |
setValue(int index,
Value arg)
Set the value at the given index into the PhiExpr.
|
boolean |
setValue(Unit predTailUnit,
Value arg)
Locate the argument associated with the given CFG predecessor unit
and set the value.
|
java.lang.String |
toString() |
void |
toString(UnitPrinter up) |
protected void |
updateCache()
Update predToPair cache map which could be out-of-sync due to
external setUnit or clone operations on the UnitBoxes.
|
protected java.util.List<ValueUnitPair> argPairs
protected java.util.Map<Unit,ValueUnitPair> predToPair
protected Type type
public SPhiExpr(Local leftLocal, java.util.List<Block> preds)
public java.util.List<ValueUnitPair> getArgs()
PhiExprgetArgs in interface PhiExprValueUnitPairpublic java.util.List<Value> getValues()
PhiExprpublic java.util.List<Unit> getPreds()
PhiExprpublic int getArgCount()
PhiExprgetArgCount in interface PhiExprpublic ValueUnitPair getArgBox(int index)
PhiExprpublic Value getValue(int index)
PhiExprpublic Unit getPred(int index)
PhiExprpublic int getArgIndex(Unit predTailUnit)
PhiExprgetArgIndex in interface PhiExprpublic ValueUnitPair getArgBox(Unit predTailUnit)
PhiExprpublic Value getValue(Unit predTailUnit)
PhiExprpublic int getArgIndex(Block pred)
PhiExprgetArgIndex in interface PhiExprpublic ValueUnitPair getArgBox(Block pred)
PhiExprpublic Value getValue(Block pred)
PhiExprpublic boolean setArg(int index,
Value arg,
Unit predTailUnit)
PhiExprpublic boolean setArg(int index,
Value arg,
Block pred)
PhiExprpublic boolean setValue(int index,
Value arg)
PhiExprpublic boolean setValue(Unit predTailUnit, Value arg)
PhiExprpublic boolean setValue(Block pred, Value arg)
PhiExprpublic boolean setPred(int index,
Unit predTailUnit)
PhiExprpublic boolean setPred(int index,
Block pred)
PhiExprpublic boolean removeArg(int index)
PhiExprpublic boolean removeArg(Unit predTailUnit)
PhiExprpublic boolean removeArg(Block pred)
PhiExprpublic boolean removeArg(ValueUnitPair arg)
PhiExprpublic boolean addArg(Value arg, Block pred)
PhiExprpublic boolean addArg(Value arg, Unit predTailUnit)
PhiExprpublic void setBlockId(int blockId)
PhiExprsetBlockId in interface PhiExprpublic int getBlockId()
PhiExprgetBlockId in interface PhiExprprotected void updateCache()
public boolean equivTo(java.lang.Object o)
EquivTopublic int equivHashCode()
EquivToequivHashCode in interface EquivTopublic java.util.List<UnitBox> getUnitBoxes()
getUnitBoxes in interface UnitBoxOwnerpublic void clearUnitBoxes()
clearUnitBoxes in interface UnitBoxOwnerpublic java.util.List<ValueBox> getUseBoxes()
ValuegetUseBoxes in interface Valuepublic Type getType()
PhiExprpublic java.lang.String toString()
toString in class java.lang.Objectpublic void toString(UnitPrinter up)
public void apply(Switch sw)
Switchableapply in interface PhiExprapply in interface Switchable