retdec
|
A representation of a call graph (CG). More...
#include <cg.h>
Classes | |
class | CalledFuncs |
Information about called functions from a caller. More... | |
Public Types | |
using | CallerCalleeMap = std::map< ShPtr< Function >, ShPtr< CalledFuncs > > |
Mapping of a caller into callees. More... | |
using | caller_iterator = CallerCalleeMap::const_iterator |
Callers iterator. More... | |
Public Member Functions | |
ShPtr< Module > | getCorrespondingModule () const |
Returns the module for which this call graph has been created. More... | |
ShPtr< CalledFuncs > | getCalledFuncs (ShPtr< Function > func, bool includeIndirectCalls=false) const |
Returns called functions from the given function. More... | |
Callers Accessors | |
caller_iterator | caller_begin () const |
Returns an iterator to the first caller. More... | |
caller_iterator | caller_end () const |
Returns an iterator past the last caller. More... | |
Private Member Functions | |
CG (ShPtr< Module > module) | |
Constructs a new call graph. More... | |
ShPtr< CalledFuncs > | computeIndirectCalls (ShPtr< CalledFuncs > calledFuncs) const |
Computes indirect calls from the given called functions. More... | |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable ()=default | |
~NonCopyable ()=default | |
Private Attributes | |
ShPtr< Module > | module |
Module for which this call graph has been created. More... | |
CallerCalleeMap | callerCalleeMap |
Mapping of a caller into callees. More... | |
Friends | |
class | CGBuilder |
A representation of a call graph (CG).
See http://en.wikipedia.org/wiki/Call_graph.
Use CGBuilder to create instances of this class. Whenever the underlying module is changed in a way that would affect the validity of the generated CG, the CG has to be re-built.
Instances of this class have reference object semantics.
This class is not meant to be subclassed.
using retdec::llvmir2hll::CG::caller_iterator = CallerCalleeMap::const_iterator |
Callers iterator.
using retdec::llvmir2hll::CG::CallerCalleeMap = std::map<ShPtr<Function>, ShPtr<CalledFuncs> > |
Mapping of a caller into callees.
Constructs a new call graph.
[in] | module | Module for which this call graph is created. |
CG::caller_iterator retdec::llvmir2hll::CG::caller_begin | ( | ) | const |
Returns an iterator to the first caller.
CG::caller_iterator retdec::llvmir2hll::CG::caller_end | ( | ) | const |
Returns an iterator past the last caller.
|
private |
Computes indirect calls from the given called functions.
This function doesn't change calledFuncs.
ShPtr< CG::CalledFuncs > retdec::llvmir2hll::CG::getCalledFuncs | ( | ShPtr< Function > | func, |
bool | includeIndirectCalls = false |
||
) | const |
Returns called functions from the given function.
[in] | func | Function for which called functions are obtained. |
[in] | includeIndirectCalls | If true , also indirect calls are considered, e.g. if func calls foo() and foo() calls bar() , then bar() is included into the result. |
If func is a declaration, then the callees
data member of the result will be empty.
If func doesn't belong to the underlying module, the null pointer is returned.
Returns the module for which this call graph has been created.
|
friend |
|
private |
Mapping of a caller into callees.
Module for which this call graph has been created.