src: refactored name resolvers

* added classes that represent different name kinds
* rewrote NameResolvers to return the new name classes instead of NameElement and NameHierarchy
* removed DataType classes since their functionality moved to the CxxTypeName class.
This commit is contained in:
malte_langkabel
2016-11-16 15:37:02 +01:00
parent a35e8a53de
commit 7873710ba8
42 changed files with 873 additions and 691 deletions
@@ -4,7 +4,6 @@
#include <clang/AST/DeclTemplate.h>
#include "data/parser/cxx/name_resolver/CxxTypeNameResolver.h"
#include "data/type/NamedDataType.h"
#include "utility/logging/logging.h"
CxxTemplateArgumentNameResolver::CxxTemplateArgumentNameResolver()
@@ -23,7 +22,7 @@ CxxTemplateArgumentNameResolver::~CxxTemplateArgumentNameResolver()
std::string CxxTemplateArgumentNameResolver::getTemplateArgumentName(const clang::TemplateArgument& argument)
{
// This doesn't work correctly if the template argument is dependent.
// This doesn't work correctly if the template argument is dependent.
// If that's required: build name from depth and index of template arg.
const clang::TemplateArgument::ArgKind kind = argument.getKind();
switch (kind)
@@ -31,7 +30,7 @@ std::string CxxTemplateArgumentNameResolver::getTemplateArgumentName(const clang
case clang::TemplateArgument::Type:
{
CxxTypeNameResolver typeNameResolver(getIgnoredContextDecls());
return typeNameResolver.qualTypeToDataType(argument.getAsType())->getFullTypeName();
return typeNameResolver.getName(argument.getAsType())->toString();
}
case clang::TemplateArgument::Integral:
case clang::TemplateArgument::Null: