| 1276 | } |
| 1277 | |
| 1278 | void DUContext::applyUpwardsAliases(SearchItem::PtrList& identifiers, const TopDUContext* /*source*/) const |
| 1279 | { |
| 1280 | if (type() == Namespace) { |
| 1281 | if (d_func()->m_scopeIdentifier.isEmpty()) |
| 1282 | return; |
| 1283 | |
| 1284 | //Make sure we search for the items in all namespaces of the same name, by duplicating each one with the namespace-identifier prepended. |
| 1285 | //We do this by prepending items to the current identifiers that equal the local scope identifier. |
| 1286 | SearchItem::Ptr newItem(new SearchItem(d_func()->m_scopeIdentifier.identifier())); |
| 1287 | |
| 1288 | //This will exclude explicitly global identifiers |
| 1289 | newItem->addToEachNode(identifiers); |
| 1290 | |
| 1291 | if (!newItem->next.isEmpty()) { |
| 1292 | //Prepend the full scope before newItem |
| 1293 | DUContext* parent = m_dynamicData->m_parentContext.data(); |
| 1294 | while (parent) { |
| 1295 | newItem = SearchItem::Ptr(new SearchItem(parent->d_func()->m_scopeIdentifier, newItem)); |
| 1296 | parent = parent->m_dynamicData->m_parentContext.data(); |
| 1297 | } |
| 1298 | |
| 1299 | newItem->isExplicitlyGlobal = true; |
| 1300 | identifiers.insert(identifiers.begin(), newItem); |
| 1301 | } |
| 1302 | } |
| 1303 | } |
| 1304 | |
| 1305 | bool DUContext::shouldSearchInParent(SearchFlags flags) const |
| 1306 | { |
no test coverage detected