Package com.ibm.wala.ssa
Class DefUse
- java.lang.Object
-
- com.ibm.wala.ssa.DefUse
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<SSAInstruction>
allInstructions
A Mapping from integer -> Instruction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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?Iterator<SSAInstruction>
getUses(int v)
Return all uses of the variable with the given value numberprotected void
initAllInstructions()
Initialize the allInstructions field with everySSAInstruction
in the ir.
-
-
-
Field Detail
-
allInstructions
protected final ArrayList<SSAInstruction> allInstructions
A Mapping from integer -> Instruction
-
-
Constructor Detail
-
DefUse
public DefUse(IR ir)
- Parameters:
ir
- an IR in SSA form.- Throws:
IllegalArgumentException
- if ir is null
-
-
Method Detail
-
getMaxValueNumber
protected int getMaxValueNumber()
- Returns:
- the maximum value number in a particular IR
-
initAllInstructions
protected void initAllInstructions()
Initialize the allInstructions field with everySSAInstruction
in the ir.
-
getDef
protected int getDef(SSAInstruction s, int i)
What is the ith value number defined by instruction s?
-
getUse
protected int getUse(SSAInstruction s, int i)
What is the ith value number used by instruction s?
-
getNumberOfDefs
protected int getNumberOfDefs(SSAInstruction s)
How many value numbers does instruction s def?
-
getNumberOfUses
protected int getNumberOfUses(SSAInstruction s)
How many value numbers does instruction s use?
-
getDef
public SSAInstruction getDef(int v)
- Returns:
- the
SSAInstruction
that defines the variable with value number v.
-
getUses
public Iterator<SSAInstruction> getUses(int v)
Return all uses of the variable with the given value number
-
getNumberOfUses
public int getNumberOfUses(int v)
- Parameters:
v
- a value number- Returns:
- the number of uses of the variable with the given value number
-
-