java.lang.Object
pascal.taie.analysis.pta.core.cs.element.CSVar
All Implemented Interfaces:
CSElement, Pointer, Indexable

public class CSVar extends Object implements CSElement
Represents context-sensitive variables.
  • Method Details

    • getContext

      public Context getContext()
      Specified by:
      getContext in interface CSElement
      Returns:
      the context of the context-sensitive element.
    • getVar

      public Var getVar()
      Returns:
      the variable (without context).
    • getType

      public Type getType()
      Specified by:
      getType in interface Pointer
      Returns:
      the type of this pointer
    • toString

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

      public int getIndex()
      Specified by:
      getIndex in interface Indexable
      Returns:
      index of this object. The index should be a non-negative integer.
    • getPointsToSet

      public PointsToSet getPointsToSet()
      Description copied from interface: Pointer
      Retrieves the points-to set associated with this pointer.

      This method may return null. We recommend use Pointer.getObjects() and Pointer.objects() for accessing the objects pointed by this pointer after the pointer analysis finishes.

      Specified by:
      getPointsToSet in interface Pointer
      Returns:
      the points-to set associated with this pointer.
    • setPointsToSet

      public void setPointsToSet(PointsToSet pointsToSet)
      Description copied from interface: Pointer
      Sets the associated points-to set of this pointer.
      Specified by:
      setPointsToSet in interface Pointer
    • addFilter

      public void addFilter(Predicate<CSObj> filter)
      Description copied from interface: Pointer
      Adds filter to filter out objects pointed to by this pointer.
      Specified by:
      addFilter in interface Pointer
    • getFilters

      public Set<Predicate<CSObj>> getFilters()
      Specified by:
      getFilters in interface Pointer
      Returns:
      all filters added to this pointer.
    • getObjects

      public Set<CSObj> getObjects()
      Description copied from interface: Pointer
      Safely retrieves context-sensitive objects pointed to by this pointer.
      Specified by:
      getObjects in interface Pointer
      Returns:
      an empty set if pointer has not been associated a PointsToSet; otherwise, returns set of objects in the PointsToSet.
    • objects

      public Stream<CSObj> objects()
      Description copied from interface: Pointer
      Safely retrieves context-sensitive objects pointed to by this pointer.
      Specified by:
      objects in interface Pointer
      Returns:
      an empty stream if pointer has not been associated a PointsToSet; otherwise, returns stream of objects in the PointsToSet.
    • addEdge

      public PointerFlowEdge addEdge(PointerFlowEdge edge)
      Description copied from interface: Pointer
      Adds a pointer flow edge and returns the edge in the PFG. If the edge to add already exists, then
      • if the edge is of FlowKind.OTHER, returns the existing edge;
      • otherwise, returns null, meaning that the edge does not need to be processed again.
      Specified by:
      addEdge in interface Pointer
    • removeEdgesIf

      public void removeEdgesIf(Predicate<PointerFlowEdge> filter)
      Description copied from interface: Pointer
      Removes out edges of this pointer if they satisfy the filter.

      Note: This method should not be called outside of Plugin.onPhaseFinish(), otherwise it may break the monotonicity of pointer analysis.

      Specified by:
      removeEdgesIf in interface Pointer
    • getOutEdges

      public Set<PointerFlowEdge> getOutEdges()
      Specified by:
      getOutEdges in interface Pointer
      Returns:
      out edges of this pointer in pointer flow graph.
    • getOutDegree

      public int getOutDegree()
      Specified by:
      getOutDegree in interface Pointer
      Returns:
      out degree of this pointer in pointer flow graph.