Interface CallGraph
-
- All Known Implementing Classes:
BaseCallGraph
public interface CallGraph
A callgraph of the program to analyze, that knows how to resolve dynamic targets ofUnresolvedCall
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<CodeMember>
getCallees(CodeMember cm)
Yields all theCodeMember
s that are called by the given one.java.util.Collection<CodeMember>
getCallers(CodeMember cm)
Yields all theCodeMember
s that call the given one.java.util.Collection<Call>
getCallSites(CodeMember cm)
Yields all theCall
s that targets the givenCodeMember
.void
init(Application app)
Initializes the call graph of the given program.void
registerCall(CFGCall call)
Call
resolve(UnresolvedCall call, java.util.Set<Type>[] types, SymbolAliasing aliasing)
Yields aCall
implementation that corresponds to the resolution of the givenUnresolvedCall
.
-
-
-
Method Detail
-
init
void init(Application app) throws CallGraphConstructionException
Initializes the call graph of the given program.- Parameters:
app
- the application to analyze- Throws:
CallGraphConstructionException
- if an exception happens while building the call graph
-
resolve
Call resolve(UnresolvedCall call, java.util.Set<Type>[] types, SymbolAliasing aliasing) throws CallResolutionException
Yields aCall
implementation that corresponds to the resolution of the givenUnresolvedCall
.- Parameters:
call
- the call to resolvetypes
- the runtime types of the parameters of the callaliasing
- the symbol aliasing information- Returns:
- a collection of all the possible runtime targets
- Throws:
CallResolutionException
- if this call graph is unable to resolve the given call
-
registerCall
void registerCall(CFGCall call)
- Parameters:
call
- the call to register
-
getCallers
java.util.Collection<CodeMember> getCallers(CodeMember cm)
Yields all theCodeMember
s 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 theCodeMember
s 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
-
getCallSites
java.util.Collection<Call> getCallSites(CodeMember cm)
Yields all theCall
s that targets the givenCodeMember
. 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 calls that target the code member
-
-