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:
Eberhard Graether
2014-07-08 16:38:40 +02:00
parent 0f60a9a556
commit af54da4ce4
13 changed files with 466 additions and 7 deletions
+12
View File
@@ -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;