Class AbstractCallGraph<CallSite,Method>
java.lang.Object
pascal.taie.analysis.graph.callgraph.AbstractCallGraph<CallSite,Method>
- Type Parameters:
CallSite
- type of call sitesMethod
- type of methods
- All Implemented Interfaces:
Serializable
,Iterable<Method>
,CallGraph<CallSite,
,Method> StmtResult<Set<Method>>
,Graph<Method>
- Direct Known Subclasses:
CSCallGraph
,DefaultCallGraph
public abstract class AbstractCallGraph<CallSite,Method>
extends Object
implements CallGraph<CallSite,Method>
Common functionality for
CallGraph
implementations.
This class contains the data structures and methods for storing and
accessing information of a call graph. The logic of modifying
(adding new call edges and methods) is left to its subclasses.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionSet of reachable methods. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
edges()
edgesOutOf
(CallSite callSite) getCalleesOf
(CallSite callSite) getCalleesOfM
(Method caller) getCallersOf
(Method callee) getCallSitesIn
(Method method) getContainerOf
(CallSite callSite) getInEdgesOf
(Method method) getNodes()
int
int
getOutEdgesOf
(Method method) getPredsOf
(Method node) getSuccsOf
(Method node) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface pascal.taie.analysis.graph.callgraph.CallGraph
callSitesIn
Methods inherited from interface pascal.taie.util.graph.Graph
getInDegreeOf, getNumberOfNodes, getOutDegreeOf, hasEdge, hasEdge, hasNode, iterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface pascal.taie.analysis.StmtResult
getResult, isRelevant
-
Field Details
-
callSiteToEdges
-
calleeToEdges
-
callSiteToContainer
-
callSitesIn
-
entryMethods
-
reachableMethods
Set of reachable methods. This field is not final so that it allows subclasses choose more efficient data structure.
-
-
Constructor Details
-
AbstractCallGraph
public AbstractCallGraph()
-
-
Method Details
-
getCallersOf
- Specified by:
getCallersOf
in interfaceCallGraph<CallSite,
Method> - Returns:
- the call sites that invoke the given method.
-
getCalleesOf
- Specified by:
getCalleesOf
in interfaceCallGraph<CallSite,
Method> - Returns:
- the methods that are called by the given call site.
-
getCalleesOfM
- Specified by:
getCalleesOfM
in interfaceCallGraph<CallSite,
Method> - Returns:
- the methods that are called by all call sites in the given method.
-
getContainerOf
- Specified by:
getContainerOf
in interfaceCallGraph<CallSite,
Method> - Returns:
- the method that contains the given call site.
-
getCallSitesIn
- Specified by:
getCallSitesIn
in interfaceCallGraph<CallSite,
Method> - Returns:
- the call sites within the given method.
-
edgesOutOf
- Specified by:
edgesOutOf
in interfaceCallGraph<CallSite,
Method> - Returns:
- the call edges out of the given call site.
-
edgesInTo
-
edges
-
getNumberOfEdges
public int getNumberOfEdges()- Specified by:
getNumberOfEdges
in interfaceCallGraph<CallSite,
Method> - Returns:
- the number of call graph edges in this call graph.
-
entryMethods
- Specified by:
entryMethods
in interfaceCallGraph<CallSite,
Method> - Returns:
- the entry methods of this call graph.
-
reachableMethods
- Specified by:
reachableMethods
in interfaceCallGraph<CallSite,
Method> - Returns:
- all reachable methods in this call graph.
-
getNumberOfMethods
public int getNumberOfMethods()- Specified by:
getNumberOfMethods
in interfaceCallGraph<CallSite,
Method> - Returns:
- the number of reachable methods in this call graph.
-
contains
-
getInEdgesOf
public Set<pascal.taie.analysis.graph.callgraph.MethodEdge<CallSite,Method>> getInEdgesOf(Method method) - Specified by:
getInEdgesOf
in interfaceGraph<CallSite>
- Returns:
- incoming edges of the given node.
-
getOutEdgesOf
public Set<pascal.taie.analysis.graph.callgraph.MethodEdge<CallSite,Method>> getOutEdgesOf(Method method) - Specified by:
getOutEdgesOf
in interfaceGraph<CallSite>
- Returns:
- outgoing edges of the given node.
-
getPredsOf
- Specified by:
getPredsOf
in interfaceGraph<CallSite>
- Returns:
- the predecessors of given node in this graph.
-
getSuccsOf
- Specified by:
getSuccsOf
in interfaceGraph<CallSite>
- Returns:
- the successors of given node in this graph.
-
getNodes
-