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

Alkis Evlogimenos alkis at cs.uiuc.edu
Mon Mar 29 15:15:01 PST 2004


Changes in directory llvm/test/Programs:

GenerateReport.pl updated: 1.19 -> 1.20

---
Log message:

 Add option to generate csv output


---
Diffs of the changes:  (+13 -0)

Index: llvm/test/Programs/GenerateReport.pl
diff -u llvm/test/Programs/GenerateReport.pl:1.19 llvm/test/Programs/GenerateReport.pl:1.20
--- llvm/test/Programs/GenerateReport.pl:1.19	Mon Mar 29 10:57:42 2004
+++ llvm/test/Programs/GenerateReport.pl	Mon Mar 29 15:14:47 2004
@@ -19,6 +19,7 @@
 my $HTML = 0;
 my $LATEX = 0;
 my $GRAPHS = 0;
+my $CSV = 0;
 
 # Parse arguments...
 while ($_ = $ARGV[0], /^[-+]/) {
@@ -29,6 +30,7 @@
   if (/^-html$/)   { $HTML = 1; next; }
   if (/^-latex$/)  { $LATEX = 1; next; }
   if (/^-graphs$/) { $GRAPHS = 1; next; }
+  if (/^-csv$/)    { $CSV = 1; next; }
 
   print "Unknown option: $_ : ignoring!\n";
 }
@@ -302,6 +304,17 @@
       Done:
         print "\\\\\n";
       }
+    }
+  } elsif ($CSV) {
+    #
+    # Print out the table as csv
+    #
+    foreach $Value (@Values) {
+      printf "$$Value[0]";
+      for ($i = 1; $i < @$Value-1; $i++) {
+        printf ",$$Value[$i]" if ($$Value[$i] ne "|");
+      }
+      print "\n";
     }
   } else {
     #





More information about the llvm-commits mailing list