public class DefUse
extends java.lang.Object
IR| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<SSAInstruction> |
allInstructions
A Mapping from integer -> Instruction
|
| Modifier and Type | Method and Description |
|---|---|
SSAInstruction |
getDef(int v) |
protected int |
getDef(SSAInstruction s,
int i)
What is the ith value number defined by instruction s?
|
protected int |
getMaxValueNumber() |
protected int |
getNumberOfDefs(SSAInstruction s)
How many value numbers does instruction s def?
|
int |
getNumberOfUses(int v) |
protected int |
getNumberOfUses(SSAInstruction s)
How many value numbers does instruction s use?
|
protected int |
getUse(SSAInstruction s,
int i)
What is the ith value number used by instruction s?
|
java.util.Iterator<SSAInstruction> |
getUses(int v)
Return all uses of the variable with the given value number
|
protected void |
initAllInstructions()
Initialize the allInstructions field with every
SSAInstruction in the ir. |
boolean |
isUnused(int v) |
protected final java.util.ArrayList<SSAInstruction> allInstructions
public DefUse(IR ir)
ir - an IR in SSA form.java.lang.IllegalArgumentException - if ir is nullprotected int getMaxValueNumber()
protected void initAllInstructions()
SSAInstruction in the ir.protected int getDef(SSAInstruction s, int i)
protected int getUse(SSAInstruction s, int i)
protected int getNumberOfDefs(SSAInstruction s)
protected int getNumberOfUses(SSAInstruction s)
public SSAInstruction getDef(int v)
SSAInstruction that defines the variable with value number v.public java.util.Iterator<SSAInstruction> getUses(int v)
public int getNumberOfUses(int v)
v - a value numberpublic boolean isUnused(int v)
v - a value number