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

Method updateImportsCache

kdevplatform/language/duchain/topducontext.cpp:434–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void TopDUContext::updateImportsCache()
435{
436 QMutexLocker lock(&importStructureMutex);
437
438 const bool use_fully_recursive_import_cache_computation = false;
439
440 if (use_fully_recursive_import_cache_computation) {
441 std::set<uint> visited;
442 TopDUContextData::updateImportCacheRecursion(this, visited);
443 Q_ASSERT(visited.find(ownIndex()) != visited.end());
444 d_func_dynamic()->m_importsCache = IndexedRecursiveImports(visited);
445 } else {
446 d_func_dynamic()->m_importsCache = IndexedRecursiveImports();
447 TopDUContextData::updateImportCacheRecursion(ownIndex(), this, d_func_dynamic()->m_importsCache);
448 }
449 Q_ASSERT(d_func_dynamic()->m_importsCache.contains(IndexedTopDUContext(this)));
450 Q_ASSERT(usingImportsCache());
451 Q_ASSERT(imports(this, CursorInRevision::invalid()));
452
453 if (parsingEnvironmentFile())
454 parsingEnvironmentFile()->setImportsCache(d_func()->m_importsCache);
455}
456
457bool TopDUContext::usingImportsCache() const
458{

Callers 3

contextImportDeclFunction · 0.80
createTopContextFunction · 0.80
buildDUChainMethod · 0.80

Calls 7

parsingEnvironmentFileFunction · 0.85
setImportsCacheMethod · 0.80
IndexedTopDUContextClass · 0.70
invalidFunction · 0.50
findMethod · 0.45
endMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected