1 #ifndef ROSE_BinaryAnalysis_Partitioner2_FunctionCallGraph_H
2 #define ROSE_BinaryAnalysis_Partitioner2_FunctionCallGraph_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
7 #include <Sawyer/Graph.h>
8 #include <Sawyer/Map.h>
11 namespace BinaryAnalysis {
12 namespace Partitioner2 {
35 size_t count()
const {
return count_; }
58 const Graph&
graph()
const {
return graph_; }
66 boost::iterator_range<Graph::ConstVertexValueIterator>
functions() {
77 Graph::ConstVertexIterator
findFunction(rose_addr_t entryVa)
const;
87 bool exists(rose_addr_t entryVa)
const;
110 Graph::EdgeIterator
insertCall(
const Graph::VertexIterator &source,
const Graph::VertexIterator &target,
120 std::vector<FunctionPtr>
callers(
const Graph::ConstVertexIterator &target)
const;
129 size_t nCallers(
const Graph::ConstVertexIterator &target)
const;
139 std::vector<FunctionPtr>
callees(
const Graph::ConstVertexIterator &source)
const;
148 size_t nCallees(
const Graph::ConstVertexIterator &source)
const;
158 size_t nCallsIn(
const Graph::ConstVertexIterator &target)
const;
168 size_t nCallsOut(
const Graph::ConstVertexIterator &source)
const;
177 size_t nCalls(
const Graph::ConstVertexIterator &source,
const Graph::ConstVertexIterator &target)
const;
size_t nCallees(const FunctionPtr &source) const
Number of functions that the specified function calls.
std::vector< FunctionPtr > callees(const FunctionPtr &source) const
List of all functions called by the specified function.
Graph::VertexIterator insertFunction(const FunctionPtr &function)
Insert a function vertex.
std::vector< FunctionPtr > callers(const FunctionPtr &target) const
List of all functions that call the specified function.
EdgeType
Partitioner control flow edge types.
Graph::ConstVertexIterator findFunction(const FunctionPtr &function) const
Find function in call graph.
Main namespace for the ROSE library.
Function call information.
boost::iterator_range< Graph::ConstVertexValueIterator > functions()
Return all functions in the call graph.
const Graph & graph() const
Underlying function call graph.
Information about each edge in the call graph.
size_t nCallers(const FunctionPtr &target) const
Number of functions that call the specified function.
size_t nCallsOut(const FunctionPtr &source) const
Total number of calls from a function.
boost::iterator_range< VertexValueIterator > vertexValues()
Iterators for all vertices.
size_t nCalls(const FunctionPtr &source, const FunctionPtr &target) const
Number of calls between two specific functions.
bool exists(const FunctionPtr &function) const
Determine if a function exists in the call graph.
FunctionCallGraph()
Constructs an empty function call graph.
size_t nCallsIn(const FunctionPtr &target) const
Total number of calls to a function.
size_t count() const
Number of inter-function control flow edges represented by this edge.
Sawyer::Container::Graph< FunctionPtr, Edge, VertexKey > Graph
Function call graph.
Graph::EdgeIterator insertCall(const FunctionPtr &source, const FunctionPtr &target, EdgeType type=E_FUNCTION_CALL, size_t edgeCount=0)
Insert a call edge.
EdgeType type() const
Type of edge.