soot.jimple.toolkits.invoke
Class InvokeGraph

java.lang.Object
  |
  +--soot.jimple.toolkits.invoke.InvokeGraph
Direct Known Subclasses:
ClosedInvokeGraph

public class InvokeGraph
extends java.lang.Object

A graph mapping invoke statements to their declaring and target methods. ClassHierarchyAnalysis is the default source of InvokeGraphs, although VTA and RTA can create or trim these graphs.


Field Summary
 MethodCallGraph mcg
           
 
Constructor Summary
InvokeGraph()
           
 
Method Summary
 void addSite(Stmt site, SootMethod container)
           
 boolean addTarget(Stmt site, SootMethod target)
          Add an InvokeGraph target to an Stmt site.
 soot.jimple.toolkits.invoke.CallGraphStats computeStats()
          Computes call graph characteristics, and stores them in the data structure CallGraphStats.
 boolean containsSite(Stmt site)
          Checks whether a site is included in the invoke graph.
 void copyTargets(Stmt roleModel, Stmt imitator)
          This method is to be called after the imitator has been addSite'd.
 java.util.Set getAllSites()
           
 java.util.List getCallingSitesOf(SootMethod target)
          Returns the callsites which potentially invoke target.
 SootMethod getDeclaringMethod(Stmt site)
          Returns the method that contains site.
 java.util.HashSet getReachableMethods()
           
 java.util.List getSitesOf(SootMethod container)
          Returns the sites of container added via addSite.
 java.util.List getTargetsOf(SootMethod m)
          Returns the list of targets of SootMethod
 java.util.List getTargetsOf(Stmt site)
           
 java.util.List getTransitiveTargetsOf(SootMethod m)
          Returns a list of SootMethods reachable from m.
 MutableDirectedGraph newMethodGraph()
           
 MutableDirectedGraph newMethodGraph(java.util.Collection methodSet)
           
 int numOfMethods()
           
 void refreshReachableMethods()
          Rebuilds the call graph to include only reachable methods.
 void removeAllTargets(Stmt site)
           
 void removeSite(Stmt site)
           
 void removeTarget(Stmt site, SootMethod target)
           
 void setReachableMethods(java.util.HashSet methods)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mcg

public MethodCallGraph mcg
Constructor Detail

InvokeGraph

public InvokeGraph()
Method Detail

getAllSites

public java.util.Set getAllSites()

refreshReachableMethods

public void refreshReachableMethods()
Rebuilds the call graph to include only reachable methods.


computeStats

public soot.jimple.toolkits.invoke.CallGraphStats computeStats()
Computes call graph characteristics, and stores them in the data structure CallGraphStats.


getDeclaringMethod

public SootMethod getDeclaringMethod(Stmt site)
Returns the method that contains site.


getSitesOf

public java.util.List getSitesOf(SootMethod container)
Returns the sites of container added via addSite. This captures all of the callsites within container. If you want all of the sites which call a given method, use getCallingSitesOf.


containsSite

public boolean containsSite(Stmt site)
Checks whether a site is included in the invoke graph.


getCallingSitesOf

public java.util.List getCallingSitesOf(SootMethod target)
Returns the callsites which potentially invoke target.


getTargetsOf

public java.util.List getTargetsOf(SootMethod m)
Returns the list of targets of SootMethod


getTransitiveTargetsOf

public java.util.List getTransitiveTargetsOf(SootMethod m)
Returns a list of SootMethods reachable from m.


getTargetsOf

public java.util.List getTargetsOf(Stmt site)

removeTarget

public void removeTarget(Stmt site,
                         SootMethod target)

removeAllTargets

public void removeAllTargets(Stmt site)

addTarget

public boolean addTarget(Stmt site,
                         SootMethod target)
Add an InvokeGraph target to an Stmt site. Note that site must previously have been addSite'd.


addSite

public void addSite(Stmt site,
                    SootMethod container)

removeSite

public void removeSite(Stmt site)

copyTargets

public void copyTargets(Stmt roleModel,
                        Stmt imitator)
This method is to be called after the imitator has been addSite'd.


newMethodGraph

public MutableDirectedGraph newMethodGraph()

newMethodGraph

public MutableDirectedGraph newMethodGraph(java.util.Collection methodSet)

getReachableMethods

public java.util.HashSet getReachableMethods()

setReachableMethods

public void setReachableMethods(java.util.HashSet methods)

numOfMethods

public int numOfMethods()