Class LiveVarNode


  • public class LiveVarNode
    extends java.lang.Object
    A LiveVarNode contains a CFG node, which can only be a LocalVariableNode or FieldAccessNode. It is used to represent the estimate of live variables at certain CFG block during dataflow analysis. We override `.equals` in this class to compare nodes by value equality rather than reference equality. We want two different nodes with the same value (that is, two nodes refer to the same live variable in the program) to be regarded as the same.
    • Constructor Detail

      • LiveVarNode

        public LiveVarNode​(Node n)
        Create a new live variable.
        Parameters:
        n - a node
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object