Interface Pointer
- All Superinterfaces:
Indexable
- All Known Implementing Classes:
ArrayIndex
,CSVar
,InstanceField
,StaticField
Represents all pointers (nodes) in context-sensitive
pointer analysis (pointer flow graph).
-
Method Summary
Modifier and TypeMethodDescriptionaddEdge
(PointerFlowEdge edge) Adds a pointer flow edge and returns the edge in the PFG.void
Adds filter to filter out objects pointed to by this pointer.Safely retrieves context-sensitive objects pointed to by this pointer.int
Retrieves the points-to set associated with this pointer.getType()
objects()
Safely retrieves context-sensitive objects pointed to by this pointer.void
removeEdgesIf
(Predicate<PointerFlowEdge> filter) Removes out edges of this pointer if they satisfy the filter.void
setPointsToSet
(PointsToSet pointsToSet) Sets the associated points-to set of this pointer.
-
Method Details
-
getPointsToSet
Retrieves the points-to set associated with this pointer.This method may return
null
. We recommend usegetObjects()
andobjects()
for accessing the objects pointed by this pointer after the pointer analysis finishes.- Returns:
- the points-to set associated with this pointer.
-
setPointsToSet
Sets the associated points-to set of this pointer. -
addFilter
Adds filter to filter out objects pointed to by this pointer. -
getFilters
- Returns:
- all filters added to this pointer.
-
getObjects
Safely retrieves context-sensitive objects pointed to by this pointer.- Returns:
- an empty set if
pointer
has not been associated aPointsToSet
; otherwise, returns set of objects in thePointsToSet
.
-
objects
Safely retrieves context-sensitive objects pointed to by this pointer.- Returns:
- an empty stream if
pointer
has not been associated aPointsToSet
; otherwise, returns stream of objects in thePointsToSet
.
-
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.
- if the edge is of
-
removeEdgesIf
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
-