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>allInstructionsA Mapping from integer -> Instruction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSAInstructiongetDef(int v)protected intgetDef(SSAInstruction s, int i)What is the ith value number defined by instruction s?protected intgetMaxValueNumber()protected intgetNumberOfDefs(SSAInstruction s)How many value numbers does instruction s def?intgetNumberOfUses(int v)protected intgetNumberOfUses(SSAInstruction s)How many value numbers does instruction s use?protected intgetUse(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 voidinitAllInstructions()Initialize the allInstructions field with everySSAInstructionin 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 everySSAInstructionin 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
SSAInstructionthat 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
-
-