[llvm-commits] CVS: llvm-test/GenerateReport.pl

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 26 16:38:15 PST 2005



Changes in directory llvm-test:

GenerateReport.pl updated: 1.25 -> 1.26
---
Log message:

When printing out a report in CSV for import to a spreadsheet, do so in latex
row order if defined.


---
Diffs of the changes:  (+28 -1)

 GenerateReport.pl |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletion(-)


Index: llvm-test/GenerateReport.pl
diff -u llvm-test/GenerateReport.pl:1.25 llvm-test/GenerateReport.pl:1.26
--- llvm-test/GenerateReport.pl:1.25	Tue Mar 22 23:38:34 2005
+++ llvm-test/GenerateReport.pl	Sat Mar 26 18:37:59 2005
@@ -316,6 +316,33 @@
         print "\\\\\n";
       }
     }
+  } elsif ($CSV && scalar(@LatexRowMapOrder)) {
+    #
+    # Print out the table as csv in the row-order specified by LatexRowMapOrder
+    #
+    for ($i = 0; $i < @LatexRowMapOrder; $i += 2) {
+      my $Name = $LatexRowMapOrder[$i];
+      if ($Name eq '-') {
+        print "----\n";
+      } else {
+        # Output benchmark name.
+        printf "$LatexRowMapOrder[$i+1]";
+
+        # Find the row that this benchmark name corresponds to.
+        foreach $Row (@Values) {
+          if ($Row->[0] eq $Name) {
+            for ($j = 1; $j < @$Row-1; $j++) {
+              print ",$$Row[$j]";
+            }
+            goto Done;
+          }
+        }
+        print "UNKNOWN Benchmark name: " . $Name;
+      Done:
+        print "\\\\\n";
+      }
+    }
+
   } elsif ($CSV) {
     #
     # Print out the table as csv
@@ -323,7 +350,7 @@
     foreach $Value (@Values) {
       printf "$$Value[0]";
       for ($i = 1; $i < @$Value-1; $i++) {
-        printf ",$$Value[$i]" if ($$Value[$i] ne "|");
+        print ",$$Value[$i]" if ($$Value[$i] ne "|");
       }
       print "\n";
     }






More information about the llvm-commits mailing list