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