kdevplatform/language/duchain
persistentsymboltable.cpp
Go to the documentation of this file.
74 PersistentSymbolTableItem(const PersistentSymbolTableItem& rhs, bool dynamic = true) : id(rhs.id)
90 //We only compare the declaration. This allows us implementing a map, although the item-repository
175 mutable ItemRepository<PersistentSymbolTableItem, PersistentSymbolTableRequestItem, true, false> m_declarations;
179 //We cache the imports so the currently used nodes are very close in memory, which leads to much better CPU cache utilization
180 mutable QHash<TopDUContext::IndexedRecursiveImports, PersistentSymbolTable::CachedIndexedRecursiveImports> m_importsCache;
208 void PersistentSymbolTable::addDeclaration(const IndexedQualifiedIdentifier& id, const IndexedDeclaration& declaration)
224 //Check whether the item is already in the mapped list, else copy the list into the new created item
233 DynamicItem<PersistentSymbolTableItem, true> editableItem = d->m_declarations.dynamicItemFromIndex(index);
277 //Check whether the item is already in the mapped list, else copy the list into the new created item
286 DynamicItem<PersistentSymbolTableItem, true> editableItem = d->m_declarations.dynamicItemFromIndex(index);
313 explicit DeclarationCacheVisitor(KDevVarLengthArray<IndexedDeclaration>& _cache) : cache(_cache)
327 const IndexedQualifiedIdentifier& id, const TopDUContext::IndexedRecursiveImports& visibility) const
350 CacheEntry<IndexedDeclaration>::DataHash::const_iterator cacheIt = cached.m_hash.constFind(visibility);
378 PersistentSymbolTable::Declarations PersistentSymbolTable::declarations(const IndexedQualifiedIdentifier& id) const
399 void PersistentSymbolTable::declarations(const IndexedQualifiedIdentifier& id, uint& countTarget,
456 qout << "Item in symbol-table is invalid:" << id.toString() << "- localIndex:" << decl.localIndex() <<
Allows simple indirect access to top-contexts with on-demand loading.
Definition: indexedtopducontext.h:35
QString * string() const
static PersistentSymbolTable & self()
Definition: persistentsymboltable.cpp:494
QTextStream &(*)(QTextStream &) TextStreamFunction
Definition: definitions.cpp:31
#define DEFINE_LIST_MEMBER_HASH(container, member, type)
Definition: appendedlist.h:218
ConvenientEmbeddedSetTreeFilterIterator< IndexedDeclaration, IndexedDeclarationHandler, IndexedTopDUContext, CachedIndexedRecursiveImports, DeclarationTopContextExtractor > FilteredDeclarationIterator
Definition: persistentsymboltable.h:142
void clearCache()
Definition: persistentsymboltable.cpp:183
QIODevice * device() const
Utils::StorableSet< IndexedTopDUContext, IndexedTopDUContextIndexConversion, RecursiveImportRepository, true > IndexedRecursiveImports
Definition: topducontext.h:290
A helper-class to store an identifier by index in a type-safe way.
Definition: identifier.h:95
void declarations(const IndexedQualifiedIdentifier &id, uint &count, const IndexedDeclaration *&declarations) const
Retrieves all the declarations for a given IndexedQualifiedIdentifier in an efficient way.
Definition: persistentsymboltable.cpp:399
#define ENSURE_CHAIN_READ_LOCKED
Macros for ensuring the DUChain is locked properly.
Definition: duchainlock.h:37
Represents a declaration only by its global indices.
Definition: indexeddeclaration.h:33
void removeDeclaration(const IndexedQualifiedIdentifier &id, const IndexedDeclaration &declaration)
Adds declaration declaration with id id to the symbol table.
Definition: persistentsymboltable.cpp:259
FilteredDeclarationIterator filteredDeclarations(const IndexedQualifiedIdentifier &id, const TopDUContext::IndexedRecursiveImports &visibility) const
Retrieves an iterator to all declarations of the given id, filtered by the visibility given through v...
Definition: persistentsymboltable.cpp:326
Global symbol-table that is stored to disk, and allows retrieving declarations that currently are not...
Definition: persistentsymboltable.h:105
Definition: abstractfunctiondeclaration.cpp:27
static Utils::BasicSetRepository * repository()
Definition: persistentsymboltable.cpp:58
void dump(const QTextStream &out)
Definition: persistentsymboltable.cpp:478
void addDeclaration(const IndexedQualifiedIdentifier &id, const IndexedDeclaration &declaration)
Adds declaration declaration with id id to the symbol table.
Definition: persistentsymboltable.cpp:208
ConstantConvenientEmbeddedSet< IndexedDeclaration, IndexedDeclarationHandler > Declarations
Definition: persistentsymboltable.h:128
#define START_APPENDED_LISTS(container)
use this if the class does not have a base class that also uses appended lists
Definition: appendedlist.h:250
Utils::StorableSet< IndexedTopDUContext, IndexedTopDUContextIndexConversion, RecursiveImportCacheRepository, true > CachedIndexedRecursiveImports
Definition: persistentsymboltable.h:138
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Apr 22 2021 23:30:47 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Apr 22 2021 23:30:47 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.