logic: fixed filepaths to always use a canonical casing (issue #516)

* added CanonicalFilePathCache to also reserve the initially recorded casing of file names
* use canonical file path cache to resolve filepaths in names of symbols (anonymous, static, ...)
* null reference fixes
This commit is contained in:
mlangkabel
2017-11-12 16:29:12 +01:00
parent 85207c6355
commit 6488c6538e
88 changed files with 277 additions and 3151 deletions
@@ -4,13 +4,17 @@
#include "data/parser/cxx/name/CxxDeclName.h"
#include "data/parser/cxx/name_resolver/CxxNameResolver.h"
class CanonicalFilePathCache;
class FilePath;
class CxxDeclNameResolver: public CxxNameResolver
{
public:
CxxDeclNameResolver();
CxxDeclNameResolver(std::vector<const clang::Decl*> ignoredContextDecls);
CxxDeclNameResolver(std::shared_ptr<CanonicalFilePathCache> canonicalFilePathCache);
CxxDeclNameResolver(
std::shared_ptr<CanonicalFilePathCache> canonicalFilePathCache,
std::vector<const clang::Decl*> ignoredContextDecls
);
virtual ~CxxDeclNameResolver();
std::shared_ptr<CxxDeclName> getName(const clang::NamedDecl* declaration);
@@ -18,9 +22,9 @@ public:
private:
std::shared_ptr<CxxName> getContextName(const clang::DeclContext* declaration);
std::shared_ptr<CxxDeclName> getDeclName(const clang::NamedDecl* declaration);
FilePath getTranslationUnitMainFilePath(const clang::Decl* declaration);
FilePath getDeclarationFilePath(const clang::Decl* declaration);
std::string getNameForAnonymousSymbol(const std::string& symbolKindName, const clang::PresumedLoc& presumedBegin);
std::string getTranslationUnitMainFileName(const clang::Decl* declaration);
std::string getDeclarationFileName(const clang::Decl* declaration);
std::string getNameForAnonymousSymbol(const std::string& symbolKindName, const clang::Decl* declaration);
std::string getTemplateParameterString(const clang::NamedDecl* parameter);
std::string getTemplateParameterTypeString(const clang::NonTypeTemplateParmDecl* parameter);
std::string getTemplateParameterTypeString(const clang::TemplateTypeParmDecl* parameter);