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

Function hasDeclarationUse

kdevplatform/language/duchain/declaration.cpp:722–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722bool hasDeclarationUse(DUContext* context, int declIdx)
723{
724 bool ret = false;
725 int usescount = context->usesCount();
726 const Use* uses = context->uses();
727
728 for (int i = 0; !ret && i < usescount; ++i) {
729 ret = uses[i].m_declarationIndex == declIdx;
730 }
731
732 const auto childContexts = context->childContexts();
733 for (DUContext* child : childContexts) {
734 ret = ret || hasDeclarationUse(child, declIdx);
735 if (ret)
736 break;
737 }
738
739 return ret;
740}
741
742bool Declaration::hasUses() const
743{

Callers 1

hasUsesMethod · 0.85

Calls 3

childContextsMethod · 0.80
usesCountMethod · 0.45
usesMethod · 0.45

Tested by

no test coverage detected