| 62 | DumpDotGraph::~DumpDotGraph() = default; |
| 63 | |
| 64 | void DumpDotGraphPrivate::addDeclaration(QTextStream& stream, Declaration* dec) |
| 65 | { |
| 66 | if (m_hadObjects.contains(dec)) |
| 67 | return; |
| 68 | |
| 69 | m_hadObjects[dec] = true; |
| 70 | |
| 71 | Declaration* declarationForDefinition = nullptr; |
| 72 | if (dynamic_cast<FunctionDefinition*>(dec)) |
| 73 | declarationForDefinition = static_cast<FunctionDefinition*>(dec)->declaration(m_topContext); |
| 74 | |
| 75 | if (!declarationForDefinition) { |
| 76 | //Declaration |
| 77 | stream << shortLabel(dec) << |
| 78 | "[shape=box, label=\"" << |
| 79 | dec->toString() << " [" << |
| 80 | dec->qualifiedIdentifier().toString() << "]" << " " << |
| 81 | rangeToString(dec->range().castToSimpleRange()) << "\"];\n"; |
| 82 | stream << shortLabel(dec->context()) << " -> " << shortLabel(dec) << "[color=green];\n"; |
| 83 | if (dec->internalContext()) |
| 84 | stream << shortLabel(dec) << " -> " << shortLabel(dec->internalContext()) << |
| 85 | "[label=\"internal\", color=blue];\n"; |
| 86 | } else { |
| 87 | //Definition |
| 88 | stream << shortLabel(dec) << "[shape=regular,color=yellow,label=\"" << declarationForDefinition->toString() << |
| 89 | " " << rangeToString(dec->range().castToSimpleRange()) << "\"];\n"; |
| 90 | stream << shortLabel(dec->context()) << " -> " << shortLabel(dec) << ";\n"; |
| 91 | |
| 92 | stream << shortLabel(dec) << " -> " << shortLabel(declarationForDefinition) << |
| 93 | "[label=\"defines\",color=green];\n"; |
| 94 | addDeclaration(stream, declarationForDefinition); |
| 95 | |
| 96 | if (dec->internalContext()) |
| 97 | stream << shortLabel(dec) << " -> " << shortLabel(dec->internalContext()) << |
| 98 | "[label=\"internal\", color=blue];\n"; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool isMaster, bool shortened) |
| 103 | { |
nothing calls this directly
no test coverage detected