All Superinterfaces:
IDElement, IDExpression, IInstructionOperand

public interface IDVar extends IDExpression
dexdec IR interface used to represent a variable (a.k.a. an identifier). Variables are factory-created by an IR context. Within a context, two variables with the same id are the same object.

Variables may be single-slot (encoded using a single register) or double-slot (encoded using a pair of registers).

Examples:

 int x = 1;
     ^  // single-slot register
 long y = 2L;
      ^  // double-slot register
 
  • Method Details

    • getId

      int getId()
      Get this variable id.
      Returns:
    • usesSingleRegister

      boolean usesSingleRegister()
      Determine whether this variable uses one slot (register) only.
      Returns:
    • usesPairOfRegisters

      boolean usesPairOfRegisters()
      Determine whether this variable uses two slots (registers).
      Returns:
    • getPreferredName

      String getPreferredName()
      Retrieve the preferred name of this identifier, if there is one. Typically, the preferred is set to the debug name, if one is provided.
      Returns:
      preferred name, may be null (in which case, a name would be auto-generated)
    • setPreferredName

      void setPreferredName(String name)
      Set the optional preferred name of this identifier.
      Parameters:
      name - optional preferred name
    • duplicate

      IDVar duplicate()
      Pseudo-duplication. For variables, this method returns this.
      Specified by:
      duplicate in interface IDElement
      Specified by:
      duplicate in interface IDExpression
      Returns:
      a deep copy of this element; the type of the duplicated element should be the same as this element's type