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

Method setDeclaration

kdevplatform/language/duchain/functiondefinition.cpp:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void FunctionDefinition::setDeclaration(Declaration* declaration)
59{
60 ENSURE_CAN_WRITE
61
62 if (declaration) {
63 DUChain::definitions()->addDefinition(declaration->id(), this);
64 d_func_dynamic()->m_declaration = declaration->id();
65 } else {
66 if (d_func()->m_declaration.isValid()) {
67 DUChain::definitions()->removeDefinition(d_func()->m_declaration, this);
68 d_func_dynamic()->m_declaration = DeclarationId();
69 }
70 }
71}
72
73Declaration* FunctionDefinition::definition(const Declaration* decl)
74{

Callers

nothing calls this directly

Calls 4

removeDefinitionMethod · 0.80
ifFunction · 0.70
DeclarationIdClass · 0.70
isValidMethod · 0.45

Tested by

no test coverage detected