| 71 | } |
| 72 | |
| 73 | Declaration* 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 | |
| 93 | Declaration* FunctionDefinition::clonePrivate() const |
| 94 | { |
nothing calls this directly
no test coverage detected