| 75 | } |
| 76 | |
| 77 | static void gc_build_histogram ( const gc_root & root, Histogram & histo ) { |
| 78 | for ( auto node = root.gc_first; node; node = node->gc_next ) { |
| 79 | uint16_t tag = node->gc_type_tag(); |
| 80 | const LineInfo * li = gc_node_at(node); |
| 81 | string key; |
| 82 | uint32_t line = 0; |
| 83 | if ( li && li->fileInfo ) { key = li->fileInfo->name; line = li->line; } |
| 84 | else { key = "<no source>"; } |
| 85 | auto & fb = histo[key]; |
| 86 | fb.total.add(tag); |
| 87 | fb.byLine[line].add(tag); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | // "[Expr 1200, TypeDecl 900]" — nonzero tags, descending by count. |
| 92 | static void gc_format_breakdown ( const TagCounts & c, TextWriter & out ) { |
no test coverage detected