Class Var

java.lang.Object
pascal.taie.ir.exp.Var
All Implemented Interfaces:
Serializable, Exp, LValue, RValue, Indexable

public class Var extends Object implements LValue, RValue, Indexable
Representation of method/constructor parameters, lambda parameters, exception parameters, and local variables.
See Also:
  • Constructor Details

  • Method Details

    • getMethod

      public JMethod getMethod()
      Returns:
      the method containing this Var.
    • getIndex

      public int getIndex()
      Specified by:
      getIndex in interface Indexable
      Returns:
      the index of this variable in the container IR.
    • getName

      public String getName()
      Returns:
      name of this Var.
    • getType

      public Type getType()
      Specified by:
      getType in interface Exp
      Returns:
      type of this expression.
    • isConst

      public boolean isConst()
      Returns:
      true if this variable is a (temporary) variable generated for holding constant value, otherwise false.
    • getConstValue

      public Literal getConstValue()
      Returns:
      the constant value held by this variable.
      Throws:
      AnalysisException - if this variable does not hold const value
    • accept

      public <T> T accept(ExpVisitor<T> visitor)
      Specified by:
      accept in interface Exp
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addLoadField

      public void addLoadField(LoadField loadField)
    • getLoadFields

      public List<LoadField> getLoadFields()
      Returns:
      LoadFields whose base variable is this Var.
    • addStoreField

      public void addStoreField(StoreField storeField)
    • getStoreFields

      public List<StoreField> getStoreFields()
      Returns:
      StoreFields whose base variable is this Var.
    • addLoadArray

      public void addLoadArray(LoadArray loadArray)
    • getLoadArrays

      public List<LoadArray> getLoadArrays()
      Returns:
      LoadArrays whose base variable is this Var.
    • addStoreArray

      public void addStoreArray(StoreArray storeArray)
    • getStoreArrays

      public List<StoreArray> getStoreArrays()
      Returns:
      StoreArrays whose base variable is this Var.
    • addInvoke

      public void addInvoke(Invoke invoke)
    • getInvokes

      public List<Invoke> getInvokes()
      Returns:
      Invokes whose base variable is this Var.