data: parsing and saving calls
This change parses calls in CxxParser by using the class ASTBodyVisitor which traverses the Stmts and Exprs in the body of the function and method declarations. The calls include: * calls in functions * calls in methods * constructor calls * constructor calls in initialization lists * implicit constructor calls of fields * calls to operators * global constructor calls of global variables * global function calls for global variables The calls don't include: * destructor calls * some calls to implicit constructors and copy constructors fortune cookie message = Don't be afraid to take that big step.
This commit is contained in:
@@ -176,6 +176,18 @@ void Storage::onInheritanceParsed(
|
||||
addTokenLocation(edge, location);
|
||||
}
|
||||
|
||||
void Storage::onCallParsed(const ParseLocation& location, const std::string& callerName, const std::string& calleeName)
|
||||
{
|
||||
log("call", callerName + " -> " + calleeName, location);
|
||||
|
||||
Node* callerNode = m_graph.createNodeHierarchy(callerName);
|
||||
Node* calleeNode = m_graph.createNodeHierarchy(calleeName);
|
||||
|
||||
Edge* edge = m_graph.createEdge(Edge::EDGE_CALL, callerNode, calleeNode);
|
||||
|
||||
addTokenLocation(edge, location);
|
||||
}
|
||||
|
||||
void Storage::logGraph() const
|
||||
{
|
||||
std::stringstream str;
|
||||
|
||||
Reference in New Issue
Block a user