Interface CallGraph
-
- All Known Implementing Classes:
BaseCallGraph
public interface CallGraphA callgraph of the program to analyze, that knows how to resolve dynamic targets ofUnresolvedCalls.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<CodeMember>getCallees(CodeMember cm)Yields all theCodeMembers that are called by the given one.java.util.Collection<CodeMember>getCallers(CodeMember cm)Yields all theCodeMembers that call the given one.voidinit(Program program)Initializes the call graph of the given program.Callresolve(UnresolvedCall call)Yields aCallimplementation that corresponds to the resolution of the givenUnresolvedCall.
-
-
-
Method Detail
-
init
void init(Program program) throws CallGraphConstructionException
Initializes the call graph of the given program.- Parameters:
program- the program to analyze- Throws:
CallGraphConstructionException- if an exception happens while building the call graph
-
resolve
Call resolve(UnresolvedCall call) throws CallResolutionException
Yields aCallimplementation that corresponds to the resolution of the givenUnresolvedCall. This method will return:- a
CFGCall, if at least oneCFGthat matchesUnresolvedCall.getTargetName()is found. The returnedCFGCallwill be linked to all the possible runtime targets matchingUnresolvedCall.getTargetName(); - an
OpenCall, if noCFGmatchingUnresolvedCall.getTargetName()is found.
- Parameters:
call- the call to resolve- Returns:
- a collection of all the possible runtime targets
- Throws:
CallResolutionException- if this call graph is unable to resolve the given call
- a
-
getCallers
java.util.Collection<CodeMember> getCallers(CodeMember cm)
Yields all theCodeMembers that call the given one. The returned collection might contain partial results if this call graph is not fully built.- Parameters:
cm- the target code member- Returns:
- the collection of callers code members
-
getCallees
java.util.Collection<CodeMember> getCallees(CodeMember cm)
Yields all theCodeMembers that are called by the given one. The returned collection might contain partial results if this call graph is not fully built.- Parameters:
cm- the target code member- Returns:
- the collection of called code members
-
-