data: Parsing type usages within function and method bodies

This change parses type usages in function and method bodies and saves them with an edge of type EDGE_TYPE_USAGE. This
also includes base class types used in initialization lists of derived class constructors.
This commit is contained in:
Eberhard Graether
2014-07-30 22:35:30 +02:00
parent dc09860680
commit 890575cd90
14 changed files with 190 additions and 23 deletions
+11 -2
View File
@@ -238,7 +238,7 @@ void Storage::onCallParsed(const ParseLocation& location, const ParseVariable& c
void Storage::onFieldUsageParsed(const ParseLocation& location, const ParseFunction& user, const std::string& usedName)
{
log("usage", user.fullName + " -> " + usedName, location);
log("field usage", user.fullName + " -> " + usedName, location);
Node* userNode =
m_graph.createNodeHierarchyWithDistinctSignature(user.fullName, ParserClient::functionSignatureStr(user));
@@ -251,7 +251,7 @@ void Storage::onFieldUsageParsed(const ParseLocation& location, const ParseFunct
void Storage::onGlobalVariableUsageParsed(
const ParseLocation& location, const ParseFunction& user, const std::string& usedName
){
log("usage", user.fullName + " -> " + usedName, location);
log("global usage", user.fullName + " -> " + usedName, location);
Node* userNode =
m_graph.createNodeHierarchyWithDistinctSignature(user.fullName, ParserClient::functionSignatureStr(user));;
@@ -261,6 +261,15 @@ void Storage::onGlobalVariableUsageParsed(
addTokenLocation(edge, location);
}
void Storage::onTypeUsageParsed(const ParseTypeUsage& type, const ParseFunction& function)
{
log("type usage", function.fullName + " -> " + type.dataType.getRawTypeName(), type.location);
Node* functionNode =
m_graph.createNodeHierarchyWithDistinctSignature(function.fullName, ParserClient::functionSignatureStr(function));
addTypeEdge(functionNode, Edge::EDGE_TYPE_USAGE, type);
}
Id Storage::getIdForNodeWithName(const std::string& fullName) const
{
Node* node = m_graph.getNode(fullName);