Class DefUse

java.lang.Object
com.ibm.wala.ssa.DefUse

public class DefUse extends Object
An object which represent Def-Use information for an SSA IR
  • Field Details

    • allInstructions

      protected final ArrayList<SSAInstruction> allInstructions
      A Mapping from integer -> Instruction
  • Constructor Details

  • Method Details

    • getMaxValueNumber

      protected int getMaxValueNumber()
      Returns:
      the maximum value number in a particular IR
    • initAllInstructions

      protected void initAllInstructions()
      Initialize the allInstructions field with every SSAInstruction 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
    • isUnused

      public boolean isUnused(int v)
      Parameters:
      v - a value number
      Returns:
      true if the variable with the given value number has no uses