MCPcopy Create free account
hub / github.com/KDE/kdevelop / rebuildDynamicData

Method rebuildDynamicData

kdevplatform/language/duchain/ducontext.cpp:98–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void DUContext::rebuildDynamicData(DUContext* parent, uint ownIndex)
99{
100 Q_ASSERT(!parent || ownIndex);
101 m_dynamicData->m_topContext = parent ? parent->topContext() : static_cast<TopDUContext*>(this);
102 m_dynamicData->m_indexInTopContext = ownIndex;
103 m_dynamicData->m_parentContext = DUContextPointer(parent);
104 m_dynamicData->m_context = this;
105
106 m_dynamicData->m_childContexts.clear();
107 m_dynamicData->m_childContexts.reserve(d_func()->m_childContextsSize());
108 FOREACH_FUNCTION(const LocalIndexedDUContext &ctx, d_func()->m_childContexts) {
109 m_dynamicData->m_childContexts << ctx.data(m_dynamicData->m_topContext);
110 }
111
112 m_dynamicData->m_localDeclarations.clear();
113 m_dynamicData->m_localDeclarations.reserve(d_func()->m_localDeclarationsSize());
114 FOREACH_FUNCTION(const LocalIndexedDeclaration &idx, d_func()->m_localDeclarations) {
115 auto declaration = idx.data(m_dynamicData->m_topContext);
116 if (!declaration) {
117 qCWarning(LANGUAGE) << "child declaration number" << idx.localIndex() << "of" <<
118 d_func_dynamic()->m_localDeclarationsSize() << "is invalid";
119 continue;
120 }
121 m_dynamicData->m_localDeclarations << declaration;
122 }
123
124 DUChainBase::rebuildDynamicData(parent, ownIndex);
125}
126
127DUContextData::DUContextData()
128 : m_inSymbolTable(false)

Callers

nothing calls this directly

Calls 3

topContextMethod · 0.45
clearMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected