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

Method definition

kdevplatform/language/duchain/functiondefinition.cpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73Declaration* FunctionDefinition::definition(const Declaration* decl)
74{
75 ENSURE_CHAIN_READ_LOCKED
76 if (!decl) {
77 return nullptr;
78 }
79
80 if (decl->isFunctionDeclaration() && decl->isDefinition()) {
81 return const_cast<Declaration*>(decl);
82 }
83
84 const KDevVarLengthArray<IndexedDeclaration> allDefinitions = DUChain::definitions()->definitions(decl->id());
85 for (const IndexedDeclaration decl : allDefinitions) {
86 if (decl.data()) ///@todo Find better ways of deciding which definition to use
87 return decl.data();
88 }
89
90 return nullptr;
91}
92
93Declaration* FunctionDefinition::clonePrivate() const
94{

Callers

nothing calls this directly

Calls 5

isDefinitionMethod · 0.80
isFunctionDeclarationMethod · 0.45
definitionsMethod · 0.45
idMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected