Interface Pointer

All Superinterfaces:
Indexable
All Known Implementing Classes:
ArrayIndex, CSVar, InstanceField, StaticField

public interface Pointer extends Indexable
Represents all pointers (nodes) in context-sensitive pointer analysis (pointer flow graph).
  • Method Details

    • getPointsToSet

      @Nullable PointsToSet getPointsToSet()
      Retrieves the points-to set associated with this pointer.

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

      Returns:
      the points-to set associated with this pointer.
    • setPointsToSet

      void setPointsToSet(PointsToSet pointsToSet)
      Sets the associated points-to set of this pointer.
    • addFilter

      void addFilter(Predicate<CSObj> filter)
      Adds filter to filter out objects pointed to by this pointer.
    • getFilters

      Set<Predicate<CSObj>> getFilters()
      Returns:
      all filters added to this pointer.
    • getObjects

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

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

      PointerFlowEdge getOrAddEdge(FlowKind kind, Pointer source, Pointer target)
      Adds a pointer flow edge source -> target, and returns the edge. If the edge already exists and kind is not FlowKind.OTHER, null is returned.
    • getOutEdges

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

      int getOutDegree()
      Returns:
      out degree of this pointer in pointer flow graph.
    • getType

      Type getType()
      Returns:
      the type of this pointer