Class DefUse
java.lang.Object
com.ibm.wala.ssa.DefUse
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayList<SSAInstruction> A Mapping from integer -> Instruction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDef(int v) protected intgetDef(SSAInstruction s, int i) What is the ith value number defined by instruction s?protected intprotected intHow many value numbers does instruction s def?intgetNumberOfUses(int v) protected intHow many value numbers does instruction s use?protected intgetUse(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 voidInitialize the allInstructions field with everySSAInstructionin the ir.booleanisUnused(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 everySSAInstructionin 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
SSAInstructionthat 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
-