data: elaborated type name usage fix

* fixed node name hierarchy creation for elaborated type names (like when using the class namespaceA::B)
This commit is contained in:
malte_langkabel
2015-01-19 17:22:27 +01:00
parent 6fc61a7e22
commit 4775a87104
2 changed files with 6 additions and 6 deletions
-6
View File
@@ -883,13 +883,7 @@ Edge* Storage::addTypeEdge(Node* node, Edge::EdgeType edgeType, const ParseTypeU
return nullptr;
}
// FIXME: For some reason the TypeNameHierarchy is not always split up properly by the Parser. This might happen
// when a Type declaration is in a different file than it's usage, but this oberservation is not reliable.
std::vector<std::string> nameHierarchy = typeUsage.dataType.getTypeNameHierarchy();
if (nameHierarchy.size() == 1 && nameHierarchy[0].find('<') == std::string::npos)
{
nameHierarchy = utility::splitToVector(nameHierarchy[0], "::");
}
Node* typeNode = addNodeHierarchy(Node::NODE_UNDEFINED_TYPE, nameHierarchy);
if (!typeNode)
+6
View File
@@ -63,6 +63,12 @@ namespace utility
{
const clang::Type* type = qualType.getUnqualifiedType().getTypePtr();
if (clang::isa<clang::ElaboratedType>(type)) // get the real type here
{
const clang::ElaboratedType* et = clang::dyn_cast<clang::ElaboratedType>(type);
type = et->getNamedType().getUnqualifiedType().getTypePtr();
}
if (clang::isa<clang::TagType>(type))
{
typeNameHerarchy = getDeclNameHierarchy(clang::dyn_cast<clang::TagType>(type)->getDecl());