[llvm-commits] [www] r138440 - /www/trunk/demo/index.cgi
Tanya Lattner
tonic at nondot.org
Wed Aug 24 10:08:33 PDT 2011
Author: tbrethou
Date: Wed Aug 24 12:08:33 2011
New Revision: 138440
URL: http://llvm.org/viewvc/llvm-project?rev=138440&view=rev
Log:
Add colored diagnostics.
Patch by David Blaikie!
Modified:
www/trunk/demo/index.cgi
Modified: www/trunk/demo/index.cgi
URL: http://llvm.org/viewvc/llvm-project/www/trunk/demo/index.cgi?rev=138440&r1=138439&r2=138440&view=diff
==============================================================================
--- www/trunk/demo/index.cgi (original)
+++ www/trunk/demo/index.cgi Wed Aug 24 12:08:33 2011
@@ -16,7 +16,7 @@
if ( !-d $ROOT ) { mkdir( $ROOT, 0777 ); }
my $LOGFILE = "$ROOT/log.txt";
-my $FORM_URL = 'index.cgi';
+my $FORM_URL = 'test.cgi';
my $MAILADDR = 'sabre at nondot.org';
my $CONTACT_ADDRESS = 'Questions or comments? Email the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVMdev mailing list</a>.';
my $LOGO_IMAGE_URL = '../img/DragonSmall.png';
@@ -70,6 +70,12 @@
close LOG;
}
+sub syntaxHighlightConsoleOutput {
+ my ($input) = @_;
+ $input =~ s@\033\[(?:\d;)?(\d);?((?:\d\d)?)m@</span><span class="terminalStyle$1$2">@g;
+ return $input;
+}
+
sub dumpFile {
my ( $header, $file ) = @_;
my $result;
@@ -80,7 +86,7 @@
close FILE;
my $UnhilightedResult = $result;
my $HtmlResult =
- "<h3>$header</h3>\n<pre>\n" . $c->escapeHTML($result) . "\n</pre>\n";
+ "<h3>$header</h3>\n<pre>\n<span>" . syntaxHighlightConsoleOutput($c->escapeHTML($result)) . "</span>\n</pre>\n";
if (wantarray) {
return ( $UnhilightedResult, $HtmlResult );
}
@@ -367,7 +373,7 @@
$options .= " -O3" if $c->param('optlevel') ne "None";
try_run( "llvm C/C++ front-end (clang)",
- "clang -emit-llvm -msse3 -W -Wall $options $stats -o $bytecodeFile -c $inputFile > $outputFile 2>&1",
+ "clang -fcolor-diagnostics -emit-llvm -msse3 -W -Wall $options $stats -o $bytecodeFile -c $inputFile > $outputFile 2>&1",
$outputFile );
if ( $c->param('showstats') && -s $timerFile ) {
More information about the llvm-commits
mailing list