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.
    • addEdge

      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.
    • removeEdgesIf

      void removeEdgesIf(Predicate<PointerFlowEdge> filter)
      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.

    • 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