Class ArrayIndex
java.lang.Object
pascal.taie.analysis.pta.core.cs.element.ArrayIndex
Represents array index pointers.
-
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.getArray()
int
getIndex()
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.toString()
-
Method Details
-
getArray
- Returns:
- the array object.
-
getType
- Returns:
- the type of this pointer
-
toString
-
getIndex
public int getIndex() -
getPointsToSet
Description copied from interface:Pointer
Retrieves the points-to set associated with this pointer.This method may return
null
. We recommend usePointer.getObjects()
andPointer.objects()
for accessing the objects pointed by this pointer after the pointer analysis finishes.- Specified by:
getPointsToSet
in interfacePointer
- Returns:
- the points-to set associated with this pointer.
-
setPointsToSet
Description copied from interface:Pointer
Sets the associated points-to set of this pointer.- Specified by:
setPointsToSet
in interfacePointer
-
addFilter
Description copied from interface:Pointer
Adds filter to filter out objects pointed to by this pointer. -
getFilters
- Specified by:
getFilters
in interfacePointer
- Returns:
- all filters added to this pointer.
-
getObjects
Description copied from interface:Pointer
Safely retrieves context-sensitive objects pointed to by this pointer.- Specified by:
getObjects
in interfacePointer
- Returns:
- an empty set if
pointer
has not been associated aPointsToSet
; otherwise, returns set of objects in thePointsToSet
.
-
objects
Description copied from interface:Pointer
Safely retrieves context-sensitive objects pointed to by this pointer. -
addEdge
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.
- if the edge is of
-
removeEdgesIf
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 interfacePointer
-
getOutEdges
- Specified by:
getOutEdges
in interfacePointer
- Returns:
- out edges of this pointer in pointer flow graph.
-
getOutDegree
public int getOutDegree()- Specified by:
getOutDegree
in interfacePointer
- Returns:
- out degree of this pointer in pointer flow graph.
-