logic: name cache

* implemented name caching while visiting the AST of a translation unit.
This commit is contained in:
malte_langkabel
2016-01-27 16:27:12 +01:00
parent 45fcf80a74
commit 297d5490c0
2 changed files with 53 additions and 32 deletions
+8 -3
View File
@@ -1,6 +1,8 @@
#ifndef AST_VISITOR_H
#define AST_VISITOR_H
#include <unordered_map>
#include "clang/AST/ASTContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
@@ -94,13 +96,16 @@ private:
ParseTypeUsage getParseTypeUsageOfReturnType(const clang::FunctionDecl* declaration) const;
std::vector<ParseTypeUsage> getParameters(const clang::FunctionDecl* declaration) const;
ParseVariable getParseVariable(const clang::DeclaratorDecl* declaration) const;
ParseFunction getParseFunction(const clang::FunctionDecl* declaration) const;
ParseFunction getParseFunction(const clang::FunctionTemplateDecl* declaration) const;
ParseVariable getParseVariable(const clang::DeclaratorDecl* declaration);
ParseFunction getParseFunction(const clang::FunctionDecl* declaration);
ParseFunction getParseFunction(const clang::FunctionTemplateDecl* declaration);
NameHierarchy getDeclNameHierarchy(const clang::Decl* decl);
clang::ASTContext* m_context;
ParserClient* m_client;
FileRegister* m_fileRegister;
std::unordered_map<const clang::Decl*, NameHierarchy> m_nameCache;
};
#endif // AST_VISITOR_H