diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-04-27 15:03:28 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:15:21 -0300 |
commit | dce8b706047d2e247833c11a265a588012ddb0cb (patch) | |
tree | 8f71937ec050615c71e125195e06ca4cc3fa9329 | |
parent | 04d571f872a8cada531646f15b2d4440b20d0d53 (diff) |
Write graph info on temp dir when some a cyclic graph is found.
-rw-r--r-- | generator/overloaddata.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/generator/overloaddata.cpp b/generator/overloaddata.cpp index 1390eea08..c670209e5 100644 --- a/generator/overloaddata.cpp +++ b/generator/overloaddata.cpp @@ -26,6 +26,7 @@ #include <graph.h> #include "overloaddata.h" #include "shibokengenerator.h" +#include <QTemporaryFile> static const TypeEntry* getAliasedTypeEntry(const TypeEntry* typeEntry) { @@ -375,7 +376,15 @@ void OverloadData::sortNextOverloads() QString funcName = referenceFunction()->name(); if (referenceFunction()->ownerClass()) funcName.prepend(referenceFunction()->ownerClass()->name() + '.'); - ReportHandler::warning(QString("Cyclic dependency found on overloaddata for '%1' method!").arg(qPrintable(funcName))); + + // Dump overload graph + QString graphName = QDir::tempPath() + '/' + funcName + ".dot"; + QHash<QString, int>::const_iterator it = sortData.map.begin(); + QHash<int, QString> nodeNames; + for (; it != sortData.map.end(); ++it) + nodeNames.insert(it.value(), it.key()); + graph.dumpDot(nodeNames, graphName); + ReportHandler::warning(QString("Cyclic dependency found on overloaddata for '%1' method! The graph boy saved the graph at %2.").arg(qPrintable(funcName)).arg(qPrintable(graphName))); } m_nextOverloadData.clear(); |