forked from OSchip/llvm-project
parent
97d2c9cae7
commit
82e547e1a9
|
@ -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 (<FROM_CHILD>) {
|
||||
|
@ -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 (<FROM_CHILD>) {
|
||||
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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
version 2
|
||||
7th April 2007
|
||||
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
|
||||
|
||||
|
||||
Instructions:
|
||||
Download this file
|
||||
Add <script src="sorttable.js"></script> 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<headrow.length; i++) {
|
||||
|
@ -92,7 +92,7 @@ sorttable = {
|
|||
dean_addEvent(headrow[i],"click", function(e) {
|
||||
|
||||
if (this.className.search(/\bsorttable_sorted\b/) != -1) {
|
||||
// if we're already sorted by this column, just
|
||||
// if we're already sorted by this column, just
|
||||
// reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted',
|
||||
|
@ -105,7 +105,7 @@ sorttable = {
|
|||
return;
|
||||
}
|
||||
if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// if we're already sorted by this column in reverse, just
|
||||
// re-reverse the table, which is quicker
|
||||
sorttable.reverse(this.sorttable_tbody);
|
||||
this.className = this.className.replace('sorttable_sorted_reverse',
|
||||
|
@ -117,7 +117,7 @@ sorttable = {
|
|||
this.appendChild(sortfwdind);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// remove sorttable_sorted classes
|
||||
theadrow = this.parentNode;
|
||||
forEach(theadrow.childNodes, function(cell) {
|
||||
|
@ -130,7 +130,7 @@ sorttable = {
|
|||
if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
|
||||
sortrevind = document.getElementById('sorttable_sortrevind');
|
||||
if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
|
||||
|
||||
|
||||
this.className += ' sorttable_sorted';
|
||||
sortfwdind = document.createElement('span');
|
||||
sortfwdind.id = "sorttable_sortfwdind";
|
||||
|
@ -151,18 +151,18 @@ sorttable = {
|
|||
sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
|
||||
/* and comment out this one */
|
||||
//row_array.sort(this.sorttable_sortfunction);
|
||||
|
||||
|
||||
tb = this.sorttable_tbody;
|
||||
for (var j=0; j<row_array.length; j++) {
|
||||
tb.appendChild(row_array[j][1]);
|
||||
}
|
||||
|
||||
|
||||
delete row_array;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
guessType: function(table, column) {
|
||||
// guess the type of a column based on its first non-blank row
|
||||
sortfn = sorttable.sort_alpha;
|
||||
|
@ -172,7 +172,7 @@ sorttable = {
|
|||
if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
|
||||
return sorttable.sort_numeric;
|
||||
}
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// check for a date: dd/mm/yyyy or dd/mm/yy
|
||||
// can have / or . or - as separator
|
||||
// can be mm/dd as well
|
||||
possdate = text.match(sorttable.DATE_RE)
|
||||
|
@ -195,17 +195,17 @@ sorttable = {
|
|||
}
|
||||
return sortfn;
|
||||
},
|
||||
|
||||
|
||||
getInnerText: function(node) {
|
||||
// gets the text we want to use for sorting for a cell.
|
||||
// strips leading and trailing whitespace.
|
||||
// this is *not* a generic getInnerText function; it's special to sorttable.
|
||||
// for example, you can override the cell text with a customkey attribute.
|
||||
// it also gets .value for <input> 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<dt2) return -1;
|
||||
return 1;
|
||||
},
|
||||
|
||||
|
||||
shaker_sort: function(list, comp_func) {
|
||||
// A stable sort function to allow multi-level sorting of data
|
||||
// see: http://en.wikipedia.org/wiki/Cocktail_sort
|
||||
|
@ -328,7 +328,7 @@ sorttable = {
|
|||
b++;
|
||||
|
||||
} // while(swap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ******************************************************************
|
||||
|
@ -490,4 +490,3 @@ var forEach = function(object, block, context) {
|
|||
resolve.forEach(object, block, context);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue