From 82e547e1a9c0909ece8caf9d78484cb61dc09c85 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 18 Feb 2014 17:21:45 +0000 Subject: [PATCH] Remove trailing spaces (no other change). Bikeshed #2 llvm-svn: 201584 --- clang/tools/scan-build/ccc-analyzer | 71 +++++++++++++++---------------- clang/tools/scan-build/scanview.css | 6 +-- clang/tools/scan-build/set-xcode-analyzer | 11 +++-- clang/tools/scan-build/sorttable.js | 55 ++++++++++++------------ 4 files changed, 70 insertions(+), 73 deletions(-) diff --git a/clang/tools/scan-build/ccc-analyzer b/clang/tools/scan-build/ccc-analyzer index 1522af8..6884162 100755 --- a/clang/tools/scan-build/ccc-analyzer +++ b/clang/tools/scan-build/ccc-analyzer @@ -31,7 +31,7 @@ my $DefaultCCompiler; my $DefaultCXXCompiler; my $IsCXX; -if (`uname -a` =~ m/Darwin/) { +if (`uname -a` =~ m/Darwin/) { $DefaultCCompiler = 'clang'; $DefaultCXXCompiler = 'clang++'; } else { @@ -42,7 +42,7 @@ if (`uname -a` =~ m/Darwin/) { if ($FindBin::Script =~ /c\+\+-analyzer/) { $Compiler = $ENV{'CCC_CXX'}; if (!defined $Compiler) { $Compiler = $DefaultCXXCompiler; } - + $Clang = $ENV{'CLANG_CXX'}; if (!defined $Clang) { $Clang = 'clang++'; } @@ -69,7 +69,7 @@ my $CleanupFile; my $ResultFile; # Remove any stale files at exit. -END { +END { if (defined $ResultFile && -z $ResultFile) { `rm -f $ResultFile`; } @@ -100,7 +100,7 @@ sub ProcessClangFailure { my ($Clang, $Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_; my $Dir = "$HtmlDir/failures"; mkpath $Dir; - + my $prefix = "clang_crash"; if ($ErrorType eq $ParserRejects) { $prefix = "clang_parser_rejects"; @@ -118,7 +118,7 @@ sub ProcessClangFailure { DIR => $Dir); system $Clang, @$Args, "-E", "-o", $PPFile; close ($PPH); - + # Create the info file. open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n"; print OUT abs_path($file), "\n"; @@ -138,7 +138,7 @@ sub ProcessClangFailure { sub GetCCArgs { my $mode = shift; my $Args = shift; - + pipe (FROM_CHILD, TO_PARENT); my $pid = fork(); if ($pid == 0) { @@ -146,7 +146,7 @@ sub GetCCArgs { open(STDOUT,">&", \*TO_PARENT); open(STDERR,">&", \*TO_PARENT); exec $Clang, "-###", $mode, @$Args; - } + } close(TO_PARENT); my $line; while () { @@ -156,7 +156,7 @@ sub GetCCArgs { waitpid($pid,0); close(FROM_CHILD); - + die "could not find clang line\n" if (!defined $line); # Strip leading and trailing whitespace characters. $line =~ s/^\s+|\s+$//g; @@ -207,7 +207,7 @@ sub Analyze { } # Display Ubiviz graph? - if (defined $ENV{'CCC_UBI'}) { + if (defined $ENV{'CCC_UBI'}) { push @Args, "-Xclang", "-analyzer-viz-egraph-ubigraph"; } @@ -228,7 +228,7 @@ sub Analyze { } if ($Verbose == 1) { # We MUST print to stderr. Some clients use the stdout output of - # gcc for various purposes. + # gcc for various purposes. print STDERR join(' ', @PrintArgs); print STDERR "\n"; } @@ -239,7 +239,7 @@ sub Analyze { # Capture the STDERR of clang and send it to a temporary file. # Capture the STDOUT of clang and reroute it to ccc-analyzer's STDERR. # We save the output file in the 'crashes' directory if clang encounters - # any problems with the file. + # any problems with the file. pipe (FROM_CHILD, TO_PARENT); my $pid = fork(); if ($pid == 0) { @@ -251,7 +251,7 @@ sub Analyze { close TO_PARENT; my ($ofh, $ofile) = tempfile("clang_output_XXXXXX", DIR => $HtmlDir); - + while () { print $ofh $_; print STDERR $_; @@ -293,15 +293,15 @@ sub Analyze { # Have we already spotted this unhandled attribute? next if (defined $attributes_not_handled{$1}); $attributes_not_handled{$1} = 1; - + # Get the name of the attribute file. my $dir = "$HtmlDir/failures"; my $afile = "$dir/attribute_ignored_$1.txt"; - + # Only create another preprocessed file if the attribute file # doesn't exist yet. next if (-e $afile); - + # Add this file to the list of files that contained this attribute. # Generate a preprocessed file if we haven't already. if (!(defined $ppfile)) { @@ -319,7 +319,7 @@ sub Analyze { } } } - + unlink($ofile); } @@ -397,7 +397,7 @@ my %LangMap = ( ); my %UniqueOptions = ( - '-isysroot' => 0 + '-isysroot' => 0 ); ##----------------------------------------------------------------------------## @@ -466,7 +466,7 @@ my $HadArch = 0; # Process the arguments. foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { - my $Arg = $ARGV[$i]; + my $Arg = $ARGV[$i]; my ($ArgKey) = split /=/,$Arg,2; # Modes ccc-analyzer supports @@ -510,7 +510,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { # and the linker. if (defined $CompilerLinkerOptionMap{$ArgKey}) { my $Cnt = $CompilerLinkerOptionMap{$ArgKey}; - + # Check if this is an option that should have a unique value, and if so # determine if the value was checked before. if ($UniqueOptions{$Arg}) { @@ -520,8 +520,8 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { } $Uniqued{$Arg} = 1; } - - push @CompileOpts,$Arg; + + push @CompileOpts,$Arg; push @LinkOpts,$Arg; while ($Cnt > 0) { @@ -531,7 +531,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { } next; } - + # Ignored options. if (defined $IgnoredOptionMap{$ArgKey}) { my $Cnt = $IgnoredOptionMap{$ArgKey}; @@ -540,10 +540,10 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { } next; } - + # Compile mode flags. if ($Arg =~ /^-[D,I,U](.*)$/) { - my $Tmp = $Arg; + my $Tmp = $Arg; if ($1 eq '') { # FIXME: Check if we are going off the end. ++$i; @@ -552,12 +552,12 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { push @CompileOpts,$Tmp; next; } - + if ($Arg =~ /-m.*/) { push @CompileOpts,$Arg; next; } - + # Language. if ($Arg eq '-x') { $Lang = $ARGV[$i+1]; @@ -570,7 +570,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { $Output = $ARGV[$i]; next; } - + # Get the link mode. if ($Arg =~ /^-[l,L,O]/) { if ($Arg eq '-O') { push @LinkOpts,'-O1'; } @@ -581,12 +581,12 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { if ($Arg =~ /^-O/) { push @CompileOpts,$Arg; } next; } - + if ($Arg =~ /^-std=/) { push @CompileOpts,$Arg; next; } - + # Get the compiler/link mode. if ($Arg =~ /^-F(.+)$/) { my $Tmp = $Arg; @@ -609,13 +609,13 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { ++$i; next; } - + if ($Arg =~ /^-f/) { push @CompileOpts,$Arg; push @LinkOpts,$Arg; next; } - + # Handle -Wno-. We don't care about extra warnings, but # we should suppress ones that we don't want to see. if ($Arg =~ /^-Wno-/) { @@ -644,7 +644,7 @@ if ($Action eq 'compile' or $Action eq 'link') { $FileLang = $LangMap{$1}; } } - + # FileLang still not defined? Skip the file. next if (!defined $FileLang); @@ -652,8 +652,8 @@ if ($Action eq 'compile' or $Action eq 'link') { next if (!defined $LangsAccepted{$FileLang}); my @CmdArgs; - my @AnalyzeArgs; - + my @AnalyzeArgs; + if ($FileLang ne 'unknown') { push @CmdArgs, '-x', $FileLang; } @@ -669,7 +669,7 @@ if ($Action eq 'compile' or $Action eq 'link') { if (defined $InternalStats) { push @AnalyzeArgs, "-analyzer-stats"; } - + if (defined $Analyses) { push @AnalyzeArgs, split '\s+', $Analyses; } @@ -715,4 +715,3 @@ if ($Action eq 'compile' or $Action eq 'link') { } exit($Status >> 8); - diff --git a/clang/tools/scan-build/scanview.css b/clang/tools/scan-build/scanview.css index a0406f3..cf8a5a6 100644 --- a/clang/tools/scan-build/scanview.css +++ b/clang/tools/scan-build/scanview.css @@ -10,7 +10,7 @@ th, table thead { text-align:center; font-weight: bold; font-family: Verdana; white-space:nowrap; -} +} .W { font-size:0px } th, td { padding:5px; padding-left:8px; text-align:left } td.SUMM_DESC { padding-left:12px } @@ -21,7 +21,7 @@ tbody.scrollContent { overflow:auto } table.form_group { background-color: #ccc; - border: 1px solid #333; + border: 1px solid #333; padding: 2px; } @@ -33,7 +33,7 @@ table.form_inner_group { table.form { background-color: #999; - border: 1px solid #333; + border: 1px solid #333; padding: 2px; } diff --git a/clang/tools/scan-build/set-xcode-analyzer b/clang/tools/scan-build/set-xcode-analyzer index 3076b39..5ac5c18 100755 --- a/clang/tools/scan-build/set-xcode-analyzer +++ b/clang/tools/scan-build/set-xcode-analyzer @@ -8,7 +8,7 @@ import sys if sys.version_info < (2, 7): print "set-xcode-analyzer requires Python 2.7 or later" sys.exit(1) - + import os import subprocess import re @@ -65,7 +65,7 @@ def main(): parser.set_description(__doc__) parser.add_option("--use-checker-build", dest="path", help="Use the Clang located at the provided absolute path, e.g. /Users/foo/checker-1") - parser.add_option("--use-xcode-clang", action="store_const", + parser.add_option("--use-xcode-clang", action="store_const", const="$(CLANG)", dest="default", help="Use the Clang bundled with Xcode") (options, args) = parser.parse_args() @@ -91,7 +91,7 @@ def main(): print "(+) Using the Clang bundled with Xcode" path = options.default isBuiltinAnalyzer = True - + try: xcode_path = subprocess.check_output(["xcode-select", "-print-path"]) except AttributeError: @@ -101,15 +101,14 @@ def main(): # Cut off the 'Developer' dir, as the xcspec lies in another part # of the Xcode.app subtree. xcode_path = os.path.dirname(xcode_path) - + foundSpec = False for x in FindClangSpecs(xcode_path): foundSpec = True ModifySpec(x, isBuiltinAnalyzer, path) - + if foundSpec == False: print "(-) No compiler configuration file was found. Xcode's analyzer has not been updated." if __name__ == '__main__': main() - diff --git a/clang/tools/scan-build/sorttable.js b/clang/tools/scan-build/sorttable.js index 4352d3b..03ebd92 100644 --- a/clang/tools/scan-build/sorttable.js +++ b/clang/tools/scan-build/sorttable.js @@ -3,19 +3,19 @@ version 2 7th April 2007 Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - + Instructions: Download this file Add to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort - + Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ - + var stIsIE = /*@cc_on!@*/false; sorttable = { @@ -26,19 +26,19 @@ sorttable = { arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); - + if (!document.createElement || !document.getElementsByTagName) return; - + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - + forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); - + }, - + makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and @@ -49,9 +49,9 @@ sorttable = { } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - + if (table.tHead.rows.length != 1) return; // can't cope with two header rows - + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, @@ -73,7 +73,7 @@ sorttable = { } delete sortbottomrows; } - + // work through each column and calculate its type headrow = table.tHead.rows[0].cells; for (var i=0; i fields. - + hasInputs = (typeof node.getElementsByTagName == 'function') && node.getElementsByTagName('input').length; - + if (node.getAttribute("sorttable_customkey") != null) { return node.getAttribute("sorttable_customkey"); } @@ -240,7 +240,7 @@ sorttable = { } } }, - + reverse: function(tbody) { // reverse the rows in a tbody newrows = []; @@ -252,14 +252,14 @@ sorttable = { } delete newrows; }, - + /* sort functions each sort function takes two parameters, a and b you are comparing a[0] and b[0] */ sort_numeric: function(a,b) { aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); if (isNaN(bb)) bb = 0; return aa-bb; }, @@ -298,7 +298,7 @@ sorttable = { if (dt1