| 22 | |
| 23 | namespace { |
| 24 | void stackCollapsedExport(QTextStream& file, int type, const Data::Costs& costs, const Data::BottomUp& node) |
| 25 | { |
| 26 | if (!node.children.isEmpty()) { |
| 27 | for (const auto& child : node.children) |
| 28 | stackCollapsedExport(file, type, costs, child); |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | auto entry = &node; |
| 33 | while (entry) { |
| 34 | if (entry->symbol.symbol.isEmpty()) |
| 35 | file << '[' << entry->symbol.binary << ']'; |
| 36 | else |
| 37 | file << Util::formatSymbol(entry->symbol); |
| 38 | entry = entry->parent; |
| 39 | if (entry) |
| 40 | file << ';'; |
| 41 | } |
| 42 | |
| 43 | // leaf node, actually generate a line and write it to the file |
| 44 | file << ' '; |
| 45 | file << costs.cost(type, node.id); |
| 46 | file << '\n'; |
| 47 | } |
| 48 | |
| 49 | void stackCollapsedExport(QFile& file, int type, const Data::BottomUpResults& results) |
| 50 | { |
no test coverage detected