[llvm-commits] CVS: llvm-www/demo/index.cgi

Reid Spencer reid at x10sys.com
Wed Aug 9 15:29:11 PDT 2006



Changes in directory llvm-www/demo:

index.cgi updated: 1.59 -> 1.60
---
Log message:

Add the invocation of llvm2cpp to the demo page. Also, rearrange the 
"what to do" options to make it more legible.


---
Diffs of the changes:  (+41 -33)

 index.cgi |   74 ++++++++++++++++++++++++++++++++++----------------------------
 1 files changed, 41 insertions(+), 33 deletions(-)


Index: llvm-www/demo/index.cgi
diff -u llvm-www/demo/index.cgi:1.59 llvm-www/demo/index.cgi:1.60
--- llvm-www/demo/index.cgi:1.59	Sat Jul 16 00:46:08 2005
+++ llvm-www/demo/index.cgi	Wed Aug  9 17:28:57 2006
@@ -5,13 +5,13 @@
 # doing remote web JO99C compilations.  (It could still be used for that
 # purpose, though the two scripts have diverged somewhat.)
 #
-# Last modified $Date: 2005/07/16 05:46:08 $
+# Last modified $Date: 2006/08/09 22:28:57 $
 #
 
 use strict;
 use CGI;
 use POSIX;
-use Mail::Send;
+# use Mail::Send;
 
 $| = 1;
 
@@ -105,8 +105,8 @@
 
 sub mailto {
     my ( $recipient, $body ) = @_;
-    my $msg =
-      new Mail::Send( Subject => "LLVM Demo Page Run", To => $recipient );
+    my $msg = "Nada";
+#      new Mail::Send( Subject => "LLVM Demo Page Run", To => $recipient );
     my $fh = $msg->open();
     print $fh $body;
     $fh->close();
@@ -187,44 +187,45 @@
 information about Stacker and <a 
 href='../docs/Stacker.html#example'>examples</a>.</p>\n";
 
-print "<table border><tr><td>";
-print
-"<p>Click here if you want Bitter Melon to run the resulting code through c++filt.  Warning, the LLVM code produced will probably not be lexically valid, but it will be easier to understand.</p><ul>",
-  $c->checkbox(
+print '<table border><tr><td wdith="30%">';
+
+print $c->checkbox(
     -name  => 'cxxdemangle',
     -label => 'Demangle C++ names with c++filt'
-  ),
-  "</ul>";
-print "</td><td>";
-
+  ),'</td><td width="70%">';
 print
-"<p>Bitter Melon can also run the link-time optimizer for you, if you like (but she won't link your code with any libraries).  Note that you have to define 'main' in your program for this to make much of a difference.</p><ul>",
-  $c->checkbox(
+"<p>Click here if you want Bitter Melon to run the resulting code through c++filt.  Warning, the LLVM code produced will probably not be lexically valid, but it will be easier to understand.</p></td></tr><tr><td>";
+
+print $c->checkbox(
     -name  => 'linkopt',
     -label => 'Run link-time optimizer',
     -checked => 'checked'
-  ),
-  "</ul>";
-
-print "</td><td>";
-
+  ),"</td><td>";
 print
-"<p>Would you believe that BitterMelon even has a stopwatch? Click here to get detailed compilation statistic and timings from each pass.</p><ul>",
-  $c->checkbox(
+"<p>Bitter Melon can also run the link-time optimizer for you, if you like (but she won't link your code with any libraries).  Note that you have to define 'main' in your program for this to make much of a difference.</p>";
+print "</td></tr><tr><td>";
+
+print $c->checkbox(
     -name  => 'showstats',
-    -label => 'Show detailed statistics'
-  ),
-  "</ul>";
-
-print "</td><td>";
-
-print "<p>And further, the cat can even produce detailed information about the bytecode file generated!",
-  " Click here to get a detailed description of the various artifacts in the bytecode file your program generates.</p><ul>",
-  $c->checkbox(
+    -label => 'Show detailed pass statistics'
+  ), "</td><td>";
+print
+"<p>Would you believe that BitterMelon even has a stopwatch? Click here to get detailed compilation statistic and timings from each pass.</p>";
+print "</td></tr><tr><td>";
+
+print $c->checkbox(
     -name => 'showbcanalysis',
-    -label => 'Show detailed bytecode information'
-  ),
-  "</ul>";
+    -label => 'Show detailed bytecode analysis'
+  ),"</td><td>";
+print "<p>And further, the cat can even produce detailed information about the bytecode file generated! Click here to get a detailed description of the various artifacts in the bytecode file your program generates.</p>";
+
+print "</td></tr><tr><td>";
+
+print $c->checkbox(
+    -name => 'showllvm2cpp',
+    -label => 'Show corresponding LLVM C++ code'
+  ),"</td><td>";
+print "<p>And, BitterMelon, that fabulously talented cat can even turn your bytecode back into LLVM C++ that would produce the same bytecode! Click here to get a C++ program that generates the equivalent bytecode for your program by direct LLVM IR calls.</p>";
 
 print "</td></tr></table>";
 
@@ -263,6 +264,9 @@
     $sanitycheckfail .= ' llvm-bcanalyzer'
       if `llvm-bcanalyzer --help 2>&1` !~ /bcanalyzer/;
 
+    $sanitycheckfail .= ' llvm2cpp' 
+      if `llvm2cpp --help 2>&1` !~ /llvm2cpp/;
+
     barf(
 "<br/>The demo page is currently unavailable. [tools: ($sanitycheckfail ) failed sanity check]"
       )
@@ -434,6 +438,10 @@
       try_run( "llvm-bcanalyzer", "llvm-bcanalyzer $bytecodeFile > $analFile 2>&1", 
         $analFile);
     }
+    if ($c->param('showllvm2cpp') ) {
+      my $l2cppFile = getname(".l2cpp");
+      try_run("llvm2cpp","llvm2cpp $bytecodeFile -o l2cppFile 2>&1",$l2cppFile);
+    }
     addlog( $source, $pid, $UnhilightedResult );
 
     my ( $ip, $host, $lg, $lines );






More information about the llvm-commits mailing list