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

Method usedDeclarationForIndex

kdevplatform/language/duchain/topducontext.cpp:1138–1149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1136}
1137
1138Declaration* TopDUContext::usedDeclarationForIndex(unsigned int declarationIndex) const
1139{
1140 ENSURE_CAN_READ
1141 if (declarationIndex & (1 << 31)) {
1142 //We use the highest bit to mark direct indices into the local declarations
1143 declarationIndex &= ~(1 << 31); //unset the highest bit
1144 return m_dynamicData->declarationForIndex(declarationIndex);
1145 } else if (declarationIndex < d_func()->m_usedDeclarationIdsSize())
1146 return d_func()->m_usedDeclarationIds()[declarationIndex].declaration(this);
1147 else
1148 return nullptr;
1149}
1150
1151int TopDUContext::indexForUsedDeclaration(Declaration* declaration, bool create)
1152{

Callers 4

usedDeclarationMethod · 0.80
itemUnderCursorInternalFunction · 0.80
highlightDUChainMethod · 0.80
highlightUseMethod · 0.80

Calls 2

declarationForIndexMethod · 0.80
declarationMethod · 0.45

Tested by

no test coverage detected