Package soot.jimple.toolkits.ide.icfg
Class AbstractJimpleBasedICFG
- java.lang.Object
-
- soot.jimple.toolkits.ide.icfg.AbstractJimpleBasedICFG
-
- All Implemented Interfaces:
heros.InterproceduralCFG<Unit,SootMethod>,BiDiInterproceduralCFG<Unit,SootMethod>
- Direct Known Subclasses:
JimpleBasedInterproceduralCFG,OnTheFlyJimpleBasedICFG
public abstract class AbstractJimpleBasedICFG extends Object implements BiDiInterproceduralCFG<Unit,SootMethod>
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.cache.LoadingCache<Body,DirectedGraph<Unit>>bodyToUnitGraphprotected booleanenableExceptionsprotected com.google.common.cache.LoadingCache<SootMethod,Set<Unit>>methodToCallsFromWithinprotected com.google.common.cache.LoadingCache<SootMethod,List<Value>>methodToParameterRefs
-
Constructor Summary
Constructors Constructor Description AbstractJimpleBasedICFG()AbstractJimpleBasedICFG(boolean enableExceptions)
-
Method Summary
-
-
-
Field Detail
-
enableExceptions
protected final boolean enableExceptions
-
bodyToUnitGraph
protected com.google.common.cache.LoadingCache<Body,DirectedGraph<Unit>> bodyToUnitGraph
-
methodToParameterRefs
protected com.google.common.cache.LoadingCache<SootMethod,List<Value>> methodToParameterRefs
-
methodToCallsFromWithin
protected com.google.common.cache.LoadingCache<SootMethod,Set<Unit>> methodToCallsFromWithin
-
-
Method Detail
-
createUnitToOwnerMap
protected Map<Unit,Body> createUnitToOwnerMap()
Creates a new map used for the unitToOwner map. Must be thread-safe.- Returns:
- a new thread-safe map
-
getMethodOf
public SootMethod getMethodOf(Unit u)
- Specified by:
getMethodOfin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
getSuccsOf
public List<Unit> getSuccsOf(Unit u)
- Specified by:
getSuccsOfin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
getOrCreateUnitGraph
public DirectedGraph<Unit> getOrCreateUnitGraph(SootMethod m)
- Specified by:
getOrCreateUnitGraphin interfaceBiDiInterproceduralCFG<Unit,SootMethod>
-
getOrCreateUnitGraph
public DirectedGraph<Unit> getOrCreateUnitGraph(Body body)
-
makeGraph
protected DirectedGraph<Unit> makeGraph(Body body)
-
getCallsFromWithinMethod
protected Set<Unit> getCallsFromWithinMethod(SootMethod m)
-
isExitStmt
public boolean isExitStmt(Unit u)
- Specified by:
isExitStmtin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
isStartPoint
public boolean isStartPoint(Unit u)
- Specified by:
isStartPointin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
isFallThroughSuccessor
public boolean isFallThroughSuccessor(Unit u, Unit succ)
- Specified by:
isFallThroughSuccessorin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
isBranchTarget
public boolean isBranchTarget(Unit u, Unit succ)
- Specified by:
isBranchTargetin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
getParameterRefs
public List<Value> getParameterRefs(SootMethod m)
- Specified by:
getParameterRefsin interfaceBiDiInterproceduralCFG<Unit,SootMethod>
-
getStartPointsOf
public Collection<Unit> getStartPointsOf(SootMethod m)
- Specified by:
getStartPointsOfin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
isCallStmt
public boolean isCallStmt(Unit u)
- Specified by:
isCallStmtin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
allNonCallStartNodes
public Set<Unit> allNonCallStartNodes()
- Specified by:
allNonCallStartNodesin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
allNonCallEndNodes
public Set<Unit> allNonCallEndNodes()
- Specified by:
allNonCallEndNodesin interfaceBiDiInterproceduralCFG<Unit,SootMethod>
-
getReturnSitesOfCallAt
public Collection<Unit> getReturnSitesOfCallAt(Unit u)
- Specified by:
getReturnSitesOfCallAtin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
getCallsFromWithin
public Set<Unit> getCallsFromWithin(SootMethod m)
- Specified by:
getCallsFromWithinin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
initializeUnitToOwner
public void initializeUnitToOwner(SootMethod m)
-
initializeUnitToOwner
public void initializeUnitToOwner(Body b)
-
getPredsOf
public List<Unit> getPredsOf(Unit u)
- Specified by:
getPredsOfin interfaceBiDiInterproceduralCFG<Unit,SootMethod>- Specified by:
getPredsOfin interfaceheros.InterproceduralCFG<Unit,SootMethod>
-
getEndPointsOf
public Collection<Unit> getEndPointsOf(SootMethod m)
- Specified by:
getEndPointsOfin interfaceBiDiInterproceduralCFG<Unit,SootMethod>
-
getPredsOfCallAt
public List<Unit> getPredsOfCallAt(Unit u)
- Specified by:
getPredsOfCallAtin interfaceBiDiInterproceduralCFG<Unit,SootMethod>
-
isReturnSite
public boolean isReturnSite(Unit n)
Description copied from interface:BiDiInterproceduralCFGGets whether the given statement is a return site of at least one call- Specified by:
isReturnSitein interfaceBiDiInterproceduralCFG<Unit,SootMethod>- Parameters:
n- The statement to check- Returns:
- True if the given statement is a return site, otherwise false
-
isReachable
public boolean isReachable(Unit u)
Description copied from interface:BiDiInterproceduralCFGChecks whether the given statement is rachable from the entry point- Specified by:
isReachablein interfaceBiDiInterproceduralCFG<Unit,SootMethod>- Parameters:
u- The statement to check- Returns:
- True if there is a control flow path from the entry point of the program to the given statement, otherwise false
-
-