kdevplatform/language/duchain
topducontextdynamicdata.cpp
Go to the documentation of this file.
57 void saveDUChainItem(QVector<TopDUContextDynamicData::ArrayWithPosition>& data, DUChainBase& item,
61 //If this triggers, you have probably created an own DUChainBase based class, but haven't called setClassId(this) in the constructor.
62 qCritical() << "no class-id set for data attached to a declaration of type" << typeid(item).name();
80 const DUChainReferenceCountingEnabler rcEnabler(data.back().array.data(), data.back().array.size());
88 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800)
93 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800)
125 void validateItem(const DUChainBaseData* const data, const uchar* const mappedData, const size_t mappedDataSize)
135 const char* pointerInData(const QVector<TopDUContextDynamicData::ArrayWithPosition>& data, uint totalOffset)
222 TopDUContextDynamicData::DUChainItemStorage<Item>::DUChainItemStorage(TopDUContextDynamicData* data)
236 //Due to template specialization it's possible that a declaration is not reachable through the normal context structure.
254 void TopDUContextDynamicData::DUChainItemStorage<Item>::clearItemIndex(const Item& item, const uint index)
298 itemData = reinterpret_cast<const DUChainBaseData*>(data->m_mappedData + oldOffsets[a].dataOffset);
337 uint TopDUContextDynamicData::DUChainItemStorage<Item>::allocateItemIndex(const Item& item, const bool temporary)
458 file->write(reinterpret_cast<const char*>(offsets.data()), sizeof(ItemDataInfo) * offsets.size());
547 //This function has to be protected by an additional mutex, since it can be triggered from multiple threads at the same time
612 "- the required language-support for handling ID" << topData->classId << "is probably not loaded";
671 // qCDebug(LANGUAGE) << "storing" << m_topContext->url().str() << m_topContext->ownIndex() << "import-count:" << m_topContext->importedParentContexts().size();
696 m_topContextData.append({QByteArray(DUChainItemSystem::self().dynamicSize(*m_topContext->d_func()),
701 //We don't need these structures any more, since we have loaded all the declarations/contexts, and m_data
705 const auto oldData = m_data; //Keep the old data alive until everything is stored into a new data structure
716 //We always put 1 byte to the front, so we don't have zero data-offsets, since those are used for "invalid".
764 // qCDebug(LANGUAGE) << "stored" << m_topContext->url().str() << m_topContext->ownIndex() << "import-count:" << m_topContext->importedParentContexts().size();
767 TopDUContextDynamicData::ItemDataInfo TopDUContextDynamicData::writeDataInfo(const ItemDataInfo& info,
788 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800)
uint m_indexInTopContext
Definition: ducontextdynamicdata.h:78
bool isTemporaryContextIndex(uint index) const
Definition: topducontextdynamicdata.cpp:826
bool isContextForIndexLoaded(uint index) const
Definition: topducontextdynamicdata.cpp:821
friend class LocalIndexedDUContext
Definition: topducontext.h:374
QString number(int n, int base)
virtual void close()
bool resize(qint64 sz)
static TopDUContext * load(uint topContextIndex)
Loads the top-context from disk, or returns zero on failure.
Definition: topducontextdynamicdata.cpp:594
bool remove()
DUContext * contextForIndex(uint index) const
Definition: topducontextdynamicdata.cpp:836
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
QByteArray & append(char ch)
~TopDUContextDynamicData()
Definition: topducontextdynamicdata.cpp:495
void append(const T &value)
Flag used during destruction.
Definition: topducontextdynamicdata.h:109
void makeDynamic()
After this was called, the data-pointer is dynamic. It is cloned if needed.
Definition: duchainbase.cpp:132
void clearProblems()
Definition: topducontextdynamicdata.cpp:874
reference back()
bool exists() const
uint dataOffset
Definition: topducontextdynamicdata.h:111
uint allocateDeclarationIndex(Declaration *decl, bool temporary)
Allocates an index for the given declaration in this top-context.
Definition: topducontextdynamicdata.cpp:801
Declaration * declarationForIndex(uint index) const
Definition: topducontextdynamicdata.cpp:848
QString fileName() const
Represents a single declaration in a definition-use chain.
Definition: declaration.h:51
static QList< IndexedDUContext > loadImports(uint topContextIndex)
Definition: topducontextdynamicdata.cpp:524
This class contains dynamic data of a top-context, and also the repository that contains all the data...
Definition: topducontextdynamicdata.h:37
void reserve(int alloc)
Definition: topducontextdata.h:51
#define FOREACH_FUNCTION(item, container)
Foreach macro that takes a container and a function-name, and will iterate through the vector returne...
Definition: appendedlist.h:213
void copy(const DUChainBaseData &from, DUChainBaseData &to, bool constant) const
This just calls the correct constructor on the target.
Definition: duchainregister.cpp:84
uint allocateContextIndex(DUContext *ctx, bool temporary)
Allocates an index for the given context in this top-context.
Definition: topducontextdynamicdata.cpp:806
TopDUContextDynamicData(TopDUContext *topContext)
Definition: topducontextdynamicdata.cpp:473
void clearDeclarationIndex(Declaration *decl)
Definition: topducontextdynamicdata.cpp:864
bool mkpath(const QString &dirPath) const
The top context in a definition-use chain for one source file.
Definition: topducontext.h:113
bool isDeclarationForIndexLoaded(uint index) const
Definition: topducontextdynamicdata.cpp:816
DUContext * context() const
Access the parent context of this declaration.
Definition: declaration.cpp:279
static IndexedString loadUrl(uint topContextIndex)
Loads only the url out of the data stored on disk for the top-context.
Definition: topducontextdynamicdata.cpp:535
void clearContextIndex(DUContext *ctx)
Definition: topducontextdynamicdata.cpp:869
uint allocateProblemIndex(const ProblemPointer &problem)
Allocates an index for the given problem in this top-context.
Definition: topducontextdynamicdata.cpp:811
bool isTemporaryDeclarationIndex(uint index) const
Definition: topducontextdynamicdata.cpp:831
ProblemPointer problemForIndex(uint index) const
Definition: topducontextdynamicdata.cpp:856
virtual qint64 size() const
static bool fileExists(uint topContextIndex)
Definition: topducontextdynamicdata.cpp:508
virtual void setData(DUChainBaseData *, bool constructorCalled=true)
This must only be used to change the storage-location or storage-kind(dynamic/constant) of the data,...
Definition: duchainbase.cpp:77
qint64 read(char *data, qint64 maxSize)
uint dynamicSize(const DUChainBaseData &data) const
Calls the dynamicSize(..) member on the given data, in the most special class. Since we cannot use vi...
Definition: duchainregister.cpp:70
static QList< IndexedDUContext > loadImporters(uint topContextIndex)
Loads only the list of importers out of the data stored on disk for the top-context.
Definition: topducontextdynamicdata.cpp:513
const char * constData() const
Definition: abstractfunctiondeclaration.cpp:27
A single context in source code, represented as a node in a directed acyclic graph.
Definition: ducontext.h:72
int size() const
bool isOnDisk() const
Whether this top-context is on disk(Either has been loaded, or has been stored)
Definition: topducontextdynamicdata.cpp:629
Definition: duchainbase.h:59
char * data()
DUContext * parentContext() const
Returns the immediate parent context of this context.
Definition: ducontext.cpp:512
qint64 write(const char *data, qint64 maxSize)
static DUChainItemSystem & self()
Access the static DUChainItemSystem instance.
Definition: duchainregister.cpp:93
Represents a context only by its global indices.
Definition: indexedducontext.h:35
void deleteOnDisk()
Stores all remnants of this top-context that are on disk. The top-context will be fully dynamic after...
Definition: topducontextdynamicdata.cpp:634
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:17 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:17 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.