C++: Introduce caches to Clone* classes

Done-with: Erik Verbruggen <erik.verbruggen@digia.com>
Task-number: QTCREATORBUG-8747

Change-Id: I7cb694f8180c6aa932b07066d98d095340111324
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: xSacha
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-07-09 13:43:43 +02:00
parent 2a74ec4ffd
commit 20f3502754
3 changed files with 33 additions and 1 deletions

View File

@@ -27,7 +27,9 @@
#include "Name.h"
#include "NameVisitor.h"
#include "SymbolVisitor.h"
#include <map>
#include <utility>
namespace CPlusPlus {
@@ -93,6 +95,9 @@ protected:
virtual void visit(ObjCForwardProtocolDeclaration *type);
protected:
typedef std::pair <const FullySpecifiedType, Subst *> TypeSubstPair;
std::map<TypeSubstPair, FullySpecifiedType> _cache;
Clone *_clone;
Control *_control;
Subst *_subst;
@@ -118,6 +123,9 @@ protected:
virtual void visit(const SelectorNameId *name);
protected:
typedef std::pair <const Name *, Subst *> NameSubstPair;
std::map<NameSubstPair, const Name *> _cache;
Clone *_clone;
Control *_control;
Subst *_subst;
@@ -163,6 +171,9 @@ protected:
virtual bool visit(ObjCPropertyDeclaration *symbol);
protected:
typedef std::pair <Symbol *, Subst *> SymbolSubstPair;
std::map<SymbolSubstPair, Symbol *> _cache;
Clone *_clone;
Control *_control;
Subst *_subst;