OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/tclsh |
| 2 # |
| 3 # A wrapper around cg_annotate that sets appropriate command-line options |
| 4 # and rearranges the output so that annotated files occur in a consistent |
| 5 # sorted order. Used by the run-speed-test.tcl script. |
| 6 # |
| 7 |
| 8 set in [open "|cg_annotate --show=Ir --auto=yes --context=40 $argv" r] |
| 9 set dest ! |
| 10 set out(!) {} |
| 11 while {![eof $in]} { |
| 12 set line [string map {\t { }} [gets $in]] |
| 13 if {[regexp {^-- Auto-annotated source: (.*)} $line all name]} { |
| 14 set dest $name |
| 15 } elseif {[regexp {^-- line \d+ ------} $line]} { |
| 16 set line [lreplace $line 2 2 {#}] |
| 17 } elseif {[regexp {^The following files chosen for } $line]} { |
| 18 set dest ! |
| 19 } |
| 20 append out($dest) $line\n |
| 21 } |
| 22 foreach x [lsort [array names out]] { |
| 23 puts $out($x) |
| 24 } |
OLD | NEW |