| 96 | } |
| 97 | |
| 98 | void 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 | |
| 127 | DUContextData::DUContextData() |
| 128 | : m_inSymbolTable(false) |
nothing calls this directly
no test coverage detected