|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
M
- the type of a methodN
- the type of a node in the CFGpublic interface ProgramRepresentation<M,N>
A wrapper for the API used by the underlying intermediate representation over which inter-procedural analysis is to be performed.
In particular, the program representation should specify program entry points, build control flow graphs for a given method and resolve virtual method calls.
Method Summary | |
---|---|
DirectedGraph<N> |
getControlFlowGraph(M method)
Returns an intra-procedural control-flow-graph for a given procedure (method). |
List<M> |
getEntryPoints()
Returns a list of program entry points (methods). |
boolean |
isCall(N node)
Returns whether a given node contains a method call. |
List<M> |
resolveTargets(M callerMethod,
N callNode)
Returns a list of target methods for call in the given node. |
Method Detail |
---|
List<M> getEntryPoints()
Client analyses implementing an InterProceduralAnalysis
must implement the
boundaryValue
method
for each entry point specified by the program representation.
DirectedGraph<N> getControlFlowGraph(M method)
The returned CFG may include exceptional control transfer in addition to conditional and unconditional jumps, but does not include inter-procedural call/return edges. Nodes containing method calls are treated like nodes containing ordinary imperative instructions.
method
- the method whose CFG to return
boolean isCall(N node)
node
- a node in the control-flow graph
List<M> resolveTargets(M callerMethod, N callNode)
For static methods and special invocations (such as constructors), there will be only one target, and hence a singleton list will be returned.
For virtual calls, there may be multiple targets which are resolved using an available call graph.
If even a single target does not have an analysable method body (e.g. native
methods in Java), then null
is returned, to indicate that the
targets cannot be properly resolved.
TODO: Native method flow functions?
callerMethod
- the method in which the call statement originatescallNode
- the node containing the call statement
null
in the case of native targets
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |