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

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 20 18:03:06 PDT 2003


Changes in directory llvm/test/Programs:

GenerateReport.pl updated: 1.9 -> 1.10

---
Log message:

Add support for sorting numerically, not textually


---
Diffs of the changes:

Index: llvm/test/Programs/GenerateReport.pl
diff -u llvm/test/Programs/GenerateReport.pl:1.9 llvm/test/Programs/GenerateReport.pl:1.10
--- llvm/test/Programs/GenerateReport.pl:1.9	Tue Feb 18 14:40:45 2003
+++ llvm/test/Programs/GenerateReport.pl	Fri Jun 20 18:01:51 2003
@@ -37,6 +37,7 @@
 # The column to sort by, to be overridden as neccesary by the report description
 my $SortCol = 0;
 my $SortReverse = 0;
+my $SortNumeric = 0;   # Sort numerically or textually?
 
 # Helper functions which may be called by the report description files...
 sub SumCols {
@@ -114,7 +115,11 @@
 #
 # Sort table now...
 #
- at Values = sort { $a->[$SortCol] cmp $b->[$SortCol] } @Values;
+if ($SortNumeric) {
+  @Values = sort { $a->[$SortCol] <=> $b->[$SortCol] } @Values;
+} else {
+  @Values = sort { $a->[$SortCol] cmp $b->[$SortCol] } @Values;
+}
 @Values = reverse @Values if ($SortReverse);
 
 #





More information about the llvm-commits mailing list