Class LocalExpr

All Implemented Interfaces:
LeafExpr, Cloneable

public class LocalExpr extends VarExpr implements LeafExpr
LocalExpr represents an expression that accesses a variable in a method's local variable table. Note that during register allocation the index becomes the color that the LocalExpr (variable) is assigned.
See Also:
  • Constructor Details

    • LocalExpr

      public LocalExpr(int index, boolean fromStack, Type type)
      Constructor.
      Parameters:
      index - Index into the local variable table for this expression.
      fromStack - Is the local allocated on the stack?
      type - The type of this expression
    • LocalExpr

      public LocalExpr(int index, Type type)
      Constructor. LocalExpr is not allocated on the stack.
      Parameters:
      index - Index into the local variable table for this expression.
      type - The type of this expression.
  • Method Details

    • fromStack

      public boolean fromStack()
    • isReturnAddress

      public boolean isReturnAddress()
      Returns true if the type of this expression is a return address.
    • visitForceChildren

      public void visitForceChildren(TreeVisitor visitor)
      Description copied from class: Node
      Visit the children of this node. Not all Nodes will have children to visit.
      Specified by:
      visitForceChildren in class Node
    • visit

      public void visit(TreeVisitor visitor)
      Specified by:
      visit in class Node
    • equalsExpr

      public boolean equalsExpr(Expr other)
      Description copied from class: Expr
      Compares this expression to another.
      Specified by:
      equalsExpr in class Expr
      Parameters:
      other - The other expression to compare against.
    • exprHashCode

      public int exprHashCode()
      Description copied from class: Expr
      Returns the hash code for this expresion.
      Specified by:
      exprHashCode in class Expr
    • clone

      public Object clone()
      Specified by:
      clone in class Expr